Bump torch to 1.8.0#2442
Conversation
|
https://github.com/optuna/optuna/pull/2442/checks?check_run_id=2035915426 |
|
Related ongoing PR #2434. |
|
The tutorial that used to require the |
|
[Just a note] I think AllenNLP will support torch v1.8.0 and torchvision v0.9.0 from the next release. |
050b51f to
72d9533
Compare
|
Currently blocked by the following error. Traceback (most recent call last):
File "examples/pytorch/pytorch_ignite_simple.py", line 133, in <module>
study.optimize(objective, n_trials=100, timeout=600)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/optuna/study.py", line 394, in optimize
show_progress_bar=show_progress_bar,
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/optuna/_optimize.py", line 76, in _optimize
progress_bar=progress_bar,
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/optuna/_optimize.py", line 163, in _optimize_sequential
trial = _run_trial(study, func, catch)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/optuna/_optimize.py", line 268, in _run_trial
raise func_err
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/optuna/_optimize.py", line 217, in _run_trial
value_or_values = func(trial)
File "examples/pytorch/pytorch_ignite_simple.py", line 106, in objective
train_loader, val_loader = get_data_loaders(TRAIN_BATCH_SIZE, VAL_BATCH_SIZE)
File "examples/pytorch/pytorch_ignite_simple.py", line 75, in get_data_loaders
train_data = MNIST(download=True, root=".", transform=data_transform, train=True)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/mnist.py", line 79, in __init__
self.download()
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/mnist.py", line 146, in download
download_and_extract_archive(url, download_root=self.raw_folder, filename=filename, md5=md5)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/utils.py", line 314, in download_and_extract_archive
download_url(url, download_root, filename, md5)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/utils.py", line 140, in download_url
raise e
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/utils.py", line 132, in download_url
_urlretrieve(url, fpath)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/torchvision/datasets/utils.py", line 29, in _urlretrieve
with urllib.request.urlopen(urllib.request.Request(url, headers={"User-Agent": USER_AGENT})) as response:
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 503: Service Unavailable |
| # TODO(crcrpar): Remove the below three lines once everything is ok. | ||
| # Register a global custom opener to avoid HTTP Error 403: Forbidden when downloading MNIST. | ||
| opener = urllib.request.build_opener() | ||
| opener.addheaders = [("User-agent", "Mozilla/5.0")] | ||
| urllib.request.install_opener(opener) | ||
|
|
||
|
|
There was a problem hiding this comment.
I'm not sure if we can remove the UA of the HTTP requests to download MNIST in the example of non-pytorch examples including Chainer. Mayb we should discuss in #2469.
There was a problem hiding this comment.
Thanks, you're absolutely right. I omitted the removals of these UA configurations.
Codecov Report
@@ Coverage Diff @@
## master #2442 +/- ##
==========================================
- Coverage 91.36% 89.78% -1.59%
==========================================
Files 135 135
Lines 11308 11308
==========================================
- Hits 10332 10153 -179
- Misses 976 1155 +179
Continue to review full report at Codecov.
|
|
PTAL. |
|
@toshihikoyanase @himkt Could you review this PR? |
HideakiImamura
left a comment
There was a problem hiding this comment.
LGTM. I think it makes sense to run the tests for non-allennlp first, and then run the tests for allennlp. These will be integrated after the next release of allennlp.
himkt
left a comment
There was a problem hiding this comment.
Let me merge this PR as we have a consensus that we should bump torch ASAP.
Motivation
Try bumping to latest torch releases.
Description of the changes
See above.