Closed harewei closed 6 years ago
f"{args.dataset} is not supported"
This is Python 3.6+ syntax. Trying removing the f or upgrading your python
@beduffy Thank you, this does indeed resolve the problem (upgrading to Python3.6). Guess I missed out on the Python 3.6+ prerequisites. These is another problem though, when I run the command to train, the following error occurs
2018-04-26 06:21:46,123:INFO::[*] Make directories : logs/ptb_2018-04-26_06-21-46
2018-04-26 06:21:53,140:INFO::regularizing:
2018-04-26 06:22:00,341:INFO::# of parameters: 146,014,000
2018-04-26 06:22:00,447:INFO::[*] MODEL dir: logs/ptb_2018-04-26_06-21-46
2018-04-26 06:22:00,447:INFO::[*] PARAM path: logs/ptb_2018-04-26_06-21-46/params.json
Traceback (most recent call last):
File "main.py", line 48, in <module>
main(args)
File "main.py", line 34, in main
trnr.train()
File "/home/username/Projects/ENAS-pytorch/trainer.py", line 216, in train
self.train_shared()
File "/home/username/Projects/ENAS-pytorch/trainer.py", line 297, in train_shared
hidden = utils.detach(hidden)
File "/home/username/Projects/ENAS-pytorch/utils.py", line 131, in detach
return tuple(detach(v) for v in h)
File "/home/username/Projects/ENAS-pytorch/utils.py", line 131, in <genexpr>
return tuple(detach(v) for v in h)
File "/home/username/Projects/ENAS-pytorch/utils.py", line 131, in detach
return tuple(detach(v) for v in h)
File "/home/username/Projects/ENAS-pytorch/utils.py", line 131, in <genexpr>
return tuple(detach(v) for v in h)
File "/home/username/Projects/ENAS-pytorch/utils.py", line 131, in detach
return tuple(detach(v) for v in h)
File "/usr/local/lib/python3.6/dist-packages/torch/tensor.py", line 360, in __iter__
raise TypeError('iteration over a 0-d tensor')
TypeError: iteration over a 0-d tensor
PyTorch 0.4.0 was released the other day with the addition of 0 dimensional tensors. In general, this will probably break all PyTorch tutorials and code.
I assume because of that error you have 0.4.0 but I could be wrong.
@beduffy That is indeed the issue. The program now runs fine when I use PyTorch 0.3.1 instead of 0.4.0. Thank you.
I suppose I'm the only one with this problem, seeing everyone else can actually run the program.
I tried both
but an error comes out with
Does anyone have any idea why? I'm using Ubuntu on Docker, with PyTorch installed (as well as those listed in requirement.txt, except pygraphviz (due to installation error, but this shouldn't raise any errors until it's actually called in utils.py, which I commented out anyway).