You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the dictionary in trajectory[2n]['info']['observation_metadata'] where n is 0,1,2,... , is actually a reference of ImageObservationProcessor.meta_data or TextObervationProcessor.meta_data.
The meta_data was created as the processor initialized, and then keep referenced all the time.
When processor.prosscess method runs and change the content of the meta_data, the trajectory changes then!
Thus: the 366 line of run_demo.py calls env.step then call _get_obs_metadata then call ObservationHandler.get_observation_metadata, it will finally reach the processor.meta_data modified by the processor.prosscess. After processor.prosscess modified the processor.meta_data, the trajectory was change the same time unexpectledy! obs, _, terminated, _, info = env.step(action) # the 366 line of run_demo.py change the trajectory unexpectledy
Solution: use deepcopy the warp the obs and info
line 322 of run_demo.py state_info: StateInfo = {"observation": obs, "info": info}
change to state_info: StateInfo = {"observation": deepcopy(obs), "info": deepcopy(info)}
line 367 of run_demo.py state_info = {"observation": obs, "info": info}
change to state_info = {"observation": deepcopy(obs), "info": deepcopy(info)}
The text was updated successfully, but these errors were encountered:
the difference reference and copy is as below:
the dictionary in trajectory[2n]['info']['observation_metadata'] where n is 0,1,2,... , is actually a reference of ImageObservationProcessor.meta_data or TextObervationProcessor.meta_data.
The meta_data was created as the processor initialized, and then keep referenced all the time.
When processor.prosscess method runs and change the content of the meta_data, the trajectory changes then!
Thus: the 366 line of run_demo.py calls env.step then call _get_obs_metadata then call ObservationHandler.get_observation_metadata, it will finally reach the processor.meta_data modified by the processor.prosscess. After processor.prosscess modified the processor.meta_data, the trajectory was change the same time unexpectledy!
obs, _, terminated, _, info = env.step(action) # the 366 line of run_demo.py change the trajectory unexpectledy
Solution: use deepcopy the warp the obs and info
state_info: StateInfo = {"observation": obs, "info": info}
change to
state_info: StateInfo = {"observation": deepcopy(obs), "info": deepcopy(info)}
state_info = {"observation": obs, "info": info}
change to
state_info = {"observation": deepcopy(obs), "info": deepcopy(info)}
The text was updated successfully, but these errors were encountered: