mlech26l / ncps

PyTorch and TensorFlow implementation of NCP, LTC, and CfC wired neural models
https://www.nature.com/articles/s42256-020-00237-3
Apache License 2.0
1.94k stars 311 forks source link

What dependency versions? #64

Closed SinanAkkoyun closed 5 months ago

SinanAkkoyun commented 5 months ago
❯ python atari_torch.py                                                                                                                        (ncps) 
2024-04-27 05:40:53,646 WARNING compression.py:16 -- lz4 not available, disabling sample compression. This will significantly impact RLlib performance. To install lz4, run `pip install lz4`.
A.L.E: Arcade Learning Environment (version 0.8.1+53f58b7)
[Powered by Stella]
/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/gymnasium/core.py:311: UserWarning: WARN: env.spec to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do `env.unwrapped.spec` for environment variables or `env.get_wrapper_attr('spec')` that will search the reminding wrappers.
  logger.warn(
Downloading data ... [done]
  0%|                                                                                                                           | 0/938 [00:00<?, ?it/s]/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/torch/nn/modules/conv.py:456: UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnFinalize Descriptor Failed cudnn_status: CUDNN_STATUS_NOT_SUPPORTED (Triggered internally at ../aten/src/ATen/native/cudnn/Conv_v8.cpp:919.)
  return F.conv2d(input, weight, bias, self.stride,
/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/torch/autograd/graph.py:744: UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnFinalize Descriptor Failed cudnn_status: CUDNN_STATUS_NOT_SUPPORTED (Triggered internally at ../aten/src/ATen/native/cudnn/Conv_v8.cpp:919.)
  return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
loss=0.3725: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 938/938 [01:21<00:00, 11.53it/s]
Epoch 1, val_loss=0.2727, val_acc=90.30%
/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/gym/utils/passive_env_checker.py:233: DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`.  (Deprecated NumPy 1.24)
  if not isinstance(terminated, (bool, np.bool8)):
Traceback (most recent call last):
  File "/home/ai/ml/tcn/ncps/test/behaviour_cloning_game/atari_torch.py", line 169, in <module>
    returns = run_closed_loop(model, env, num_episodes=10)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/ml/tcn/ncps/test/behaviour_cloning_game/atari_torch.py", line 122, in run_closed_loop
    obs = np.transpose(obs, [2, 0, 1]).astype(np.float32)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/numpy/core/fromnumeric.py", line 655, in transpose
    return _wrapfunc(a, 'transpose', axes)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ai/.mconda3/envs/ncps/lib/python3.11/site-packages/numpy/core/fromnumeric.py", line 45, in _wrapit
    result = getattr(asarray(obj), method)(*args, **kwds)
                     ^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

With the latest packages I get this error. I also tried pytorch 1.x but no luck. What package versions do I need to install?

noorchauhan commented 5 months ago

Try reinstalling, or check other dependencies

SinanAkkoyun commented 5 months ago

@noorchauhan I did, but what other deps should I check for?

If it works for you, could you please share your pip freeze so I can install those versions?

noorchauhan commented 5 months ago

Not sure what are you trying to do here, m, Try in an isolated environment first, colab/kaggle, refer: End to End Examples

SinanAkkoyun commented 5 months ago

Oh my... I missed the pip install codeblock, it specifies all versions... Thank you!