GithubHelp home page GithubHelp logo

hcnoh / gail-pytorch Goto Github PK

View Code? Open in Web Editor NEW
115.0 115.0 24.0 819 KB

A simple implementation of Generative Adversarial Imitation Learning with PyTorch

License: MIT License

Python 100.00%
deep-learning deep-reinforcement-learning gail imitation-learning openai-gym pytorch reinforcement-learning

gail-pytorch's People

Contributors

hcnoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gail-pytorch's Issues

`Pendulum` is deprecated

I am getting an error with all three environments listed in config.json for example when I run

python train.py --env_name=Pendulum-v0

I get this error:

ml/lib/python3.9/site-packages/gym/envs/registration.py", line 251, in _check_version_exists
    raise error.DeprecatedEnv(
gym.error.DeprecatedEnv: Environment version v0 for `Pendulum` is deprecated. Please use `Pendulum-v1` instead.

Error running CartPole-v1

When I run

python train.py --env_name=CartPole-v1

I get this error

  File "gail-pytorch/models/nets.py", line 128, in act
    state = FloatTensor(state)
ValueError: expected sequence of length 4 at dim 1 (got 0)

Expert Data

Hello, can I generate expert data for CartPole environment? If so how can I do it?

CUDA error: no kernel image is available for execution on the device

When I run the train.py script along with your instruction, the following error occurred.

python3 train.py --env_name=BipedalWalker-v3
/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/cuda/__init__.py:146: UserWarning: 
NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Traceback (most recent call last):
  File "train.py", line 98, in <module>
    main(**vars(args))
  File "train.py", line 54, in main
    expert = Expert(
  File "/home/dl/GAIL/gail-pytorch/models/nets.py", line 120, in __init__
    self.pi = PolicyNetwork(self.state_dim, self.action_dim, self.discrete)
  File "/home/dl/GAIL/gail-pytorch/models/nets.py", line 18, in __init__
    Linear(state_dim, 50),
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 101, in __init__
    self.reset_parameters()
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 107, in reset_parameters
    init.kaiming_uniform_(self.weight, a=math.sqrt(5))
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/nn/init.py", line 412, in kaiming_uniform_
    return tensor.uniform_(-bound, bound)
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Please let me know how to fix it.

undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11

When I run the train.py as your instruction, the following error occurred.

$ python3 train.py --env_name=BipedalWalker-v3
Traceback (most recent call last):
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/__init__.py", line 172, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 6, in <module>
    import torch
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/__init__.py", line 217, in <module>
    _load_global_deps()
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/__init__.py", line 178, in _load_global_deps
    _preload_cuda_deps()
  File "/home/dl/GAIL/GAIL/lib/python3.8/site-packages/torch/__init__.py", line 158, in _preload_cuda_deps
    ctypes.CDLL(cublas_path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/dl/GAIL/GAIL/lib/python3.8/site-packages/nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtGetStatusString, version libcublasLt.so.11

Please let me know how to fix it.

VALUE Error : expected sequence of length 24 at dim 1(got 0)

I got this error(ubuntu 20.04 ver)

(base) codms@codms-T-Series:~/gail-pytorch$ python train.py --env_name=BipedalWalker-v3
/home/codms/gail-pytorch/models/nets.py:128: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /croot/pytorch_1686931851744/work/torch/csrc/utils/tensor_new.cpp:245.)
state = FloatTensor(state)
Traceback (most recent call last):
File "/home/codms/gail-pytorch/train.py", line 98, in
main(**vars(args))
File "/home/codms/gail-pytorch/train.py", line 65, in main
results = model.train(env, expert)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/codms/gail-pytorch/models/gail.py", line 80, in train
act = expert.act(ob)
^^^^^^^^^^^^^^
File "/home/codms/gail-pytorch/models/nets.py", line 128, in act
state = FloatTensor(state)
^^^^^^^^^^^^^^^^^^
ValueError: expected sequence of length 24 at dim 1 (got 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.