JannisFengler / MuZero

Some Reinforcement Learning Algorithns
0 stars 0 forks source link

ValueError: expected sequence of length 4 at dim 1 (got 0) #1

Open science64 opened 9 months ago

science64 commented 9 months ago

I got this error while running the script. Thanks for doing it.

C:\Users\Predator\Desktop\DeepLearning AI\muzeroNew\muzero.py:81: 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 ..\torch\csrc\utils\tensor_new.cpp:248.) state = torch.tensor(obs, dtype=torch.float32) Traceback (most recent call last): File "C:\Users\Predator\Desktop\DeepLearning AI\muzeroNew\muzero.py", line 166, in train() File "C:\Users\Predator\Desktop\DeepLearning AI\muzeroNew\muzero.py", line 153, in train action, mcts_policy = muzero.select_action(obs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Predator\Desktop\DeepLearning AI\muzeroNew\muzero.py", line 81, in select_action state = torch.tensor(obs, dtype=torch.float32) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: expected sequence of length 4 at dim 1 (got 0)

JannisFengler commented 2 months ago

i reworked the whole code and this error is fixed ;)