{"action":"created","issue":{"url":"https://api.github.com/repos/allenai/allennlp/issues/308","repository_url":"https://api.github.com/repos/allenai/allennlp","labels_url":"https://api.github.com/repos/allenai/allennlp/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/allenai/allennlp/issues/308/comments","events_url":"https://api.github.com/repos/allenai/allennlp/issues/308/events","html_url":"https://github.com/allenai/allennlp/issues/308","id":257272180,"number":308,"title":"TypeError, When using GPU to run simple tagger tutorial","user":{"login":"andy-yangz","id":23011317,"avatar_url":"https://avatars3.githubusercontent.com/u/23011317?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-yangz","html_url":"https://github.com/andy-yangz","followers_url":"https://api.github.com/users/andy-yangz/followers","following_url":"https://api.github.com/users/andy-yangz/following{/other_user}","gists_url":"https://api.github.com/users/andy-yangz/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-yangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-yangz/subscriptions","organizations_url":"https://api.github.com/users/andy-yangz/orgs","repos_url":"https://api.github.com/users/andy-yangz/repos","events_url":"https://api.github.com/users/andy-yangz/events{/privacy}","received_events_url":"https://api.github.com/users/andy-yangz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-13T06:34:27Z","updated_at":"2017-10-17T18:54:42Z","closed_at":"2017-10-17T18:53:54Z","author_association":"NONE","body":"As title, when I want to run the simple tagger model from the tutorial, I find CPU is okay. But when I set the `cuda_device` to `0` to use GPU.\r\nIt gets TypeError as follow.\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\r\n    \"__main__\", mod_spec)\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/run.py\", line 13, in <module>\r\n    main(prog=\"python -m allennlp.run\")\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/commands/__init__.py\", line 27, in main\r\n    args.func(args)\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/commands/train.py\", line 97, in _train_model_from_args\r\n    train_model_from_file(args.param_path, args.serialization_dir)\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/commands/train.py\", line 116, in train_model_from_file\r\n    return train_model(params, serialization_dir)\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/commands/train.py\", line 184, in train_model\r\n    trainer.train()\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/allennlp/training/trainer.py\", line 183, in train\r\n    self._optimizer.step()\r\n  File \"/home/andy/.conda/envs/py36/lib/python3.6/site-packages/torch/optim/adam.py\", line 65, in step\r\n    exp_avg.mul_(beta1).add_(1 - beta1, grad)\r\nTypeError: add_ received an invalid combination of arguments - got (float, torch.cuda.FloatTensor), but expected one of:\r\n * (float value)\r\n * (torch.FloatTensor other)\r\n * (torch.SparseFloatTensor other)\r\n * (float value, torch.FloatTensor other)\r\n      didn't match because some of the arguments have invalid types: (float, torch.cuda.FloatTensor)\r\n * (float value, torch.SparseFloatTensor other)\r\n      didn't match because some of the arguments have invalid types: (float, torch.cuda.FloatTensor)\r\n```"},"comment":{"url":"https://api.github.com/repos/allenai/allennlp/issues/comments/337332752","html_url":"https://github.com/allenai/allennlp/issues/308#issuecomment-337332752","issue_url":"https://api.github.com/repos/allenai/allennlp/issues/308","id":337332752,"user":{"login":"matt-gardner","id":3291951,"avatar_url":"https://avatars2.githubusercontent.com/u/3291951?v=4","gravatar_id":"","url":"https://api.github.com/users/matt-gardner","html_url":"https://github.com/matt-gardner","followers_url":"https://api.github.com/users/matt-gardner/followers","following_url":"https://api.github.com/users/matt-gardner/following{/other_user}","gists_url":"https://api.github.com/users/matt-gardner/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-gardner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-gardner/subscriptions","organizations_url":"https://api.github.com/users/matt-gardner/orgs","repos_url":"https://api.github.com/users/matt-gardner/repos","events_url":"https://api.github.com/users/matt-gardner/events{/privacy}","received_events_url":"https://api.github.com/users/matt-gardner/received_events","type":"User","site_admin":false},"created_at":"2017-10-17T18:54:42Z","updated_at":"2017-10-17T18:54:42Z","author_association":"MEMBER","body":"I'm closing this due to inactivity, and because we can't reproduce it.  If you're still seeing this error, feel free to re-open the issue."}}
{"actor":{"display_login":"matt-gardner"}}