I was trying to test if my pytorch is installed correctly on a CentOS-based server. I found there are a set of programs under test dir could do the job. But when I try to run run_test.sh, it always gives me the error message like:
Traceback (most recent call last):
File “test_torch.py”, line 1896, in test_index
self.assertEqual(reference[2, None], reference[2].unsqueeze(0))
TypeError: indexing a tensor with an object of type NoneType. The only supported types are integers, slices, numpy scalars and torch.ByteTensor.
Anyone know what is going on here? I also tried on my mac, and everything works fine.
You installed pytorch from conda, which installs version 0.1.9, but you are running the tests in master, which assume the master branch of torch.
To run the tests for 0.1.9, you can do:
git clone https://github.com/pytorch/pytorch
cd pytorch
git checkout v0.1.9
cd test
./run_test.sh
ERROR: test_serialization_map_location (__main__.TestTorch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_torch.py", line 2713, in test_serialization_map_location
tensor = torch.load(test_file_path, map_location=map_location)
File "/Users/Natsume/miniconda2/envs/dlnd-tf-lab/lib/python3.5/site-packages/torch/serialization.py", line 222, in load
return _load(f, map_location, pickle_module)
File "/Users/Natsume/miniconda2/envs/dlnd-tf-lab/lib/python3.5/site-packages/torch/serialization.py", line 370, in _load
result = unpickler.load()
AttributeError: Can't get attribute '_rebuild_tensor' on <module 'torch._utils' from '/Users/Natsume/miniconda2/envs/dlnd-tf-lab/lib/python3.5/site-packages/torch/_utils.py'>
In my mac, I ran conda list pytorch , return the following:
pytorch 0.1.10 py35_1 soumith
In my downloaded pytorch-master folder, I checked the version inside setup.py and found version = '0.1.10'