higgsfield / RL-Adventure

Pytorch Implementation of DQN / DDQN / Prioritized replay/ noisy networks/ distributional values/ Rainbow/ hierarchical RL
3.02k stars 589 forks source link

ValueError: too many values to unpack (expected 4) #35

Open ppangTae opened 10 months ago

ppangTae commented 10 months ago

ValueError Traceback (most recent call last) /home/parksangtae/RL-Adventure-master/1.dqn.ipynb Cell 19 line 1 [11] epsilon = epsilon_by_frame(frame_idx) [12] action = model.act(state, epsilon) ---> [14] nextstate, reward, done, = env.step(action) [15] replay_buffer.push(state, action, reward, next_state, done) [17] state = next_state

ValueError: too many values to unpack (expected 4)

could you tell me why this error is happen?

ciel0906 commented 4 months ago

The same. Have you resolved this issue?

wxxiong commented 2 months ago

Have a try. "nextstate, reward, done, , _ = env.step(action)" for five values to unpack

daisukisatone commented 2 months ago

Have a try. "nextstate, reward, done, , _ = env.step(action)" for five values to unpack

I tried. But new errors may arise, "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."

wxxiong commented 2 months ago

chage all the code "state = env.reset()" to "state, _ = env.reset()"