numpy随机种子的位置

时间:2018-04-14 15:48:24

标签: python numpy random

我有以下用于运行自回归过程的代码:

np.random.seed(0)

正如你所看到的,我有几个职位可以放np.random.seed。我希望每次运行都选择相同的随机数集,以便我可以看到不同phi的效果。考虑到这一点,我应该在代码中放置Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 273 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: -----> Installing pip remote: Traceback (most recent call last): remote: File "/app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51/vendor/pip-pop/pip-diff", line 15, in <module> remote: from pip.req import parse_requirements remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/__init__.py", line 3, in <module> remote: from .req_install import InstallRequirement remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/req_install.py", line 25, in <module> remote: import pip.wheel remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/wheel.py", line 28, in <module> remote: from pip.download import path_to_url, unpack_url remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/download.py", line 40, in <module> remote: from pip._vendor import requests, six remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py", line 83, in <module> remote: from pip._internal.compat import WINDOWS remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in <module> remote: from pip._internal import cmdoptions remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module> remote: from pip._internal.index import ( remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_internal/index.py", line 25, in <module> remote: from pip._internal.download import HAS_TLS, is_url, path_to_url, url_to_path remote: File "/app/.heroku/python/lib/python3.6/site-packages/pip/_internal/download.py", line 326, in <module> remote: class PipSession(requests.Session): remote: AttributeError: module 'pip._vendor.requests' has no attribute 'Session' remote: mount: failure.bad-requirements: No such file or directory remote: -----> Installing requirements with pip remote: remote: -----> $ python manage.py collectstatic --noinput remote: Traceback (most recent call last): remote: File "manage.py", line 22, in <module> remote: execute_from_command_line(sys.argv) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line remote: utility.execute() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute remote: django.setup() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 27, in setup remote: apps.populate(settings.INSTALLED_APPS) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate remote: app_config.import_models() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models remote: self.models_module = import_module(models_module_name) remote: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module remote: return _bootstrap._gcd_import(name[level:], package, level) remote: File "<frozen importlib._bootstrap>", line 994, in _gcd_import remote: File "<frozen importlib._bootstrap>", line 971, in _find_and_load remote: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked remote: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked remote: File "<frozen importlib._bootstrap_external>", line 678, in exec_module remote: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed remote: File "/tmp/build_989d7449dd0cd18694a87448cb09f19f/indexapp/models.py", line 9, in <module> remote: from .image_processing import * remote: File "/tmp/build_989d7449dd0cd18694a87448cb09f19f/indexapp/image_processing.py", line 7, in <module> remote: import cv2 remote: ModuleNotFoundError: No module named 'cv2' remote: remote: ! Error while running '$ python manage.py collectstatic --noinput'. remote: See traceback above for details. remote: remote: You may need to update application code to resolve this error. remote: Or, you can disable collectstatic for this application: remote: remote: $ heroku config:set DISABLE_COLLECTSTATIC=1 remote: remote: https://devcenter.heroku.com/articles/django-assets remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to django-rest-api-comp-vision. remote: To https://git.heroku.com/django-rest-api-comp-vision.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/django-rest-api-comp-vision.git' 的位置?谢谢!

1 个答案:

答案 0 :(得分:0)