indigoLovee / DDPG

DDPG in Pytorch
MIT License
40 stars 9 forks source link

observation类型转换错误 #1

Closed Code-Newborn closed 1 year ago

Code-Newborn commented 1 year ago

image 此处运行不通过,报错: f:\Github\DDPG\DDPG.py:51: 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 C:\cb\pytorch_1000000000000\work\torch\csrc\utils\tensor_new.cpp:233.) state = T.tensor(observation, dtype=T.float).to(device) Traceback (most recent call last): File "f:\Github\DDPG\train.py", line 53, in main() File "f:\Github\DDPG\train.py", line 31, in main action = agent.choose_action(observation, train=True) File "f:\Github\DDPG\DDPG.py", line 51, in choose_action state = T.tensor(observation, dtype=T.float).to(device) ValueError: expected sequence of length 8 at dim 1 (got 0)

Yzhtc commented 1 year ago

同样的错误!

zheng85 commented 1 year ago

请问这个错误怎么解决?我也遇到了,你们解决了吗?

Code-Newborn commented 1 year ago

忘记回帖了,已解决,改成如下所示: image