cule icon indicating copy to clipboard operation
cule copied to clipboard

Runtime error relating to atari.Action class

Open ugurkanates opened this issue 4 years ago • 4 comments

Tensor.contains only supports Tensor or scalar, but you passed in a <class 'torchcule_atari.AtariAction'>

Just trying bunch of examples provided by NVIDIA but seems sadly there is a bug ?

python 3.7.0 I installed apex from github and did python setup install ( pip version was having issues?) pytorch 1.4.0 cuda version 10.2

full stack

`Traceback (most recent call last):
  File "vtrace_main.py", line 30, in <module>
    vtrace_main()
  File "vtrace_main.py", line 27, in vtrace_main
    sys.exit(main(vtrace_parser_options, worker))
  File "/home/paypaytr/Desktop/ReinforcementLearning/nvidiaAtari/cule/examples/utils/launcher.py", line 160, in main
    maybe_restart(args, worker)
  File "/home/paypaytr/Desktop/ReinforcementLearning/nvidiaAtari/cule/examples/utils/launcher.py", line 125, in maybe_restart
    dispatch(args, worker)
  File "/home/paypaytr/Desktop/ReinforcementLearning/nvidiaAtari/cule/examples/utils/launcher.py", line 80, in dispatch
    worker(args.local_rank, ngpus_per_node, args)
  File "/home/paypaytr/Desktop/ReinforcementLearning/nvidiaAtari/cule/examples/vtrace/train.py", line 35, in worker
    train_env, test_env, observation = env_initialize(args, env_device)
  File "/home/paypaytr/Desktop/ReinforcementLearning/nvidiaAtari/cule/examples/utils/initializers.py", line 79, in env_initialize
    clip_rewards=args.clip_rewards, frameskip=4)
  File "/home/paypaytr/anaconda3/lib/python3.7/site-packages/torchcule-0.1.0-py3.7-linux-x86_64.egg/torchcule/atari/env.py", line 95, in __init__
    self.fire_reset = torchcule_atari.FIRE in self.action_set
  File "/home/paypaytr/anaconda3/lib/python3.7/site-packages/torch/tensor.py", line 510, in __contains__
    type(element)
RuntimeError: Tensor.__contains__ only supports Tensor or scalar, but you passed in a <class 'torchcule_atari.AtariAction'>.

`

ugurkanates avatar May 02 '20 17:05 ugurkanates

If you want to move quick, can you try the docker image? That should work out of the box.

ifrosio avatar May 04 '20 15:05 ifrosio

@ifrosio yes thats what I did. I may also update my fork and do a PR that works with all current version of libraries and Ubuntu 20.04 LTS. This project is too good to left out die.

ugurkanates avatar May 04 '20 15:05 ugurkanates

For docker instructions we posted:

FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 as base ... RUN pip install torch==1.2.0

It looks like you are using different CUDA / pytorch versions. Any particular reason for this or can you try downgrading to CUDA 10 / pytorch 1.2 / python 3.6?

ifrosio avatar May 04 '20 15:05 ifrosio

@ifrosio Well there are two things , 1 - able to use latest versions of torch 2- For CUDA I believe NVIDIA handles that part , I don't think you can even downgrade CUDA no ? I mean I can handle torch with simple conda/ virtual env but yeah atleast CUDA part is I believe should be updated or choseable. My GPU isn't even up to date it's just one of the old models came with laptops 2GB VRAM model.

ugurkanates avatar May 07 '20 17:05 ugurkanates