{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/3717","repository_url":"https://api.github.com/repos/pytorch/pytorch","labels_url":"https://api.github.com/repos/pytorch/pytorch/issues/3717/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/3717/comments","events_url":"https://api.github.com/repos/pytorch/pytorch/issues/3717/events","html_url":"https://github.com/pytorch/pytorch/issues/3717","id":274220570,"number":3717,"title":"Pytorch AssertionError: Torch not compiled with CUDA enabled","user":{"login":"sharmalakshay93","id":8191481,"avatar_url":"https://avatars3.githubusercontent.com/u/8191481?v=4","gravatar_id":"","url":"https://api.github.com/users/sharmalakshay93","html_url":"https://github.com/sharmalakshay93","followers_url":"https://api.github.com/users/sharmalakshay93/followers","following_url":"https://api.github.com/users/sharmalakshay93/following{/other_user}","gists_url":"https://api.github.com/users/sharmalakshay93/gists{/gist_id}","starred_url":"https://api.github.com/users/sharmalakshay93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharmalakshay93/subscriptions","organizations_url":"https://api.github.com/users/sharmalakshay93/orgs","repos_url":"https://api.github.com/users/sharmalakshay93/repos","events_url":"https://api.github.com/users/sharmalakshay93/events{/privacy}","received_events_url":"https://api.github.com/users/sharmalakshay93/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-15T16:30:52Z","updated_at":"2017-11-16T04:45:50Z","closed_at":"2017-11-16T04:45:50Z","author_association":"NONE","body":"I am trying to run code from [this repo](https://github.com/eladhoffer/captionGen). I have disabled cuda by changing lines 39/40 in [main.py](https://github.com/eladhoffer/captionGen/blob/master/main.py) from\r\n\r\n```Python\r\nparser.add_argument('--type', default='torch.cuda.FloatTensor', help='type of tensor - e.g torch.cuda.HalfTensor')\r\n```\r\n\r\nto\r\n\r\n```Python\r\nparser.add_argument('--type', default='torch.FloatTensor', help='type of tensor - e.g torch.HalfTensor')\r\n```\r\n\r\nHowever, I keep receiving the aforementioned AssertionError. Below is the trace:\r\n\r\n```Python\r\nTraceback (most recent call last):\r\n  File \"main.py\", line 190, in <module>\r\n    main()\r\n  File \"main.py\", line 178, in main\r\n    model, train_data, training=True, optimizer=optimizer)\r\n  File \"main.py\", line 135, in forward\r\n    for i, (imgs, (captions, lengths)) in enumerate(data):\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 201, in __next__\r\n    return self._process_next_batch(batch)\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 221, in _process_next_batch\r\n    raise batch.exc_type(batch.exc_msg)\r\nAssertionError: Traceback (most recent call last):\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 62, in _pin_memory_loop\r\n    batch = pin_memory_batch(batch)\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 123, in pin_memory_batch\r\n    return [pin_memory_batch(sample) for sample in batch]\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 123, in <listcomp>\r\n    return [pin_memory_batch(sample) for sample in batch]\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py\", line 117, in pin_memory_batch\r\n    return batch.pin_memory()\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/tensor.py\", line 82, in pin_memory\r\n    return type(self)().set_(storage.pin_memory()).view_as(self)\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/storage.py\", line 83, in pin_memory\r\n    allocator = torch.cuda._host_allocator()\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/cuda/__init__.py\", line 220, in _host_allocator\r\n    _lazy_init()\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/cuda/__init__.py\", line 84, in _lazy_init\r\n    _check_driver()\r\n  File \"/Users/lakshay/anaconda/lib/python3.6/site-packages/torch/cuda/__init__.py\", line 51, in _check_driver\r\n    raise AssertionError(\"Torch not compiled with CUDA enabled\")\r\nAssertionError: Torch not compiled with CUDA enabled\r\n```\r\n\r\nUnable to figure this out. Please help? Thanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/comments/344814558","html_url":"https://github.com/pytorch/pytorch/issues/3717#issuecomment-344814558","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/3717","id":344814558,"user":{"login":"soumith","id":1310570,"avatar_url":"https://avatars0.githubusercontent.com/u/1310570?v=4","gravatar_id":"","url":"https://api.github.com/users/soumith","html_url":"https://github.com/soumith","followers_url":"https://api.github.com/users/soumith/followers","following_url":"https://api.github.com/users/soumith/following{/other_user}","gists_url":"https://api.github.com/users/soumith/gists{/gist_id}","starred_url":"https://api.github.com/users/soumith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumith/subscriptions","organizations_url":"https://api.github.com/users/soumith/orgs","repos_url":"https://api.github.com/users/soumith/repos","events_url":"https://api.github.com/users/soumith/events{/privacy}","received_events_url":"https://api.github.com/users/soumith/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T04:45:50Z","updated_at":"2017-11-16T04:45:50Z","author_association":"OWNER","body":"you are running this on OSX. The OSX binary of PyTorch does not come with GPU support.\r\n\r\nThe code you linked to still has some GPU stuff remaining (as you see from the stack-trace.\r\n\r\nChange these two lines to get_iterator:\r\nhttps://github.com/eladhoffer/captionGen/blob/48552694775ef11f5fa68c100584f40d98e4b690/main.py#L96\r\n\r\n`get_iterator(..., pin_memory=False)`\r\n"}}
{"actor":{"display_login":"soumith"}}