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
Hello. There is a cv2 error on running any baseline code from general/chainerrl/baselines (after fixing this issue). Here's the traceback on running the GAIL.py baseline:
Traceback (most recent call last):
File "gail.py", line 421, in <module>
main()
File "gail.py", line 146, in main
_main(args)
File "gail.py", line 291, in _main
shuffle=False)
File "C:\MineRL\baselines\general\chainerrl\baselines\expert_dataset.py", line 110, in __init__
self._convert(original_dataset)
File "C:\MineRL\baselines\general\chainerrl\baselines\expert_dataset.py", line 120, in _convert
obs = self.observation_converter(orig_obs)
File "C:\MineRL\baselines\general\chainerrl\baselines\observation_wrappers.py", line 24, in converter
cv2.cvtColor(obs, cv2.COLOR_RGB2GRAY), axis=-1)
cv2.error: OpenCV(4.3.0) c:\projects\opencv-python\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::`anonymous-namespace'::CvtHelper<struct cv::impl::`anonymous namespace'::Set<3,4,-1>,struct cv::impl::A0xe227985e::Set<1,-1,-1>,struct cv::impl::A0xe227985e::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
> Invalid number of channels in input image:
> 'VScn::contains(scn)'
> where
> 'scn' is 1
Exception in thread QueueManagerThread:
Traceback (most recent call last):
File "C:\Users\prabh\Miniconda3\envs\minerlpk\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\prabh\Miniconda3\envs\minerlpk\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\prabh\Miniconda3\envs\minerlpk\lib\concurrent\futures\process.py", line 354, in _queue_management_worker
ready = wait(readers + worker_sentinels)
File "C:\Users\prabh\Miniconda3\envs\minerlpk\lib\multiprocessing\connection.py", line 872, in wait
ov.cancel()
OSError: [WinError 6] The handle is invalid
Failed to delete the temporary minecraft directory.
On tracing the issue, turns out what's fed into self.observation_converter() and self.action_converter() variables has shape (1, 32, 64, 64, 3) instead of (32, 64, 64, 3) (introduced from the new DataPipeline.batch_iter(**1**, 32, 1))
So, in both observation_wrappers.py and action_wrappers.py we need to ignore the first dim (use dict[keys][0] instead of dict[keys]) and append the dim on return (return np.expand_dims(list, 0) instead of return list). This seems to fix the problem
Note: dict = observation, action and list = ret, val in the two files, respectively
PS: If the spaces weren't dict, we could fix this by just initializing the converters as lambda x: x[0] instead of lambda x: x :v
System Info
Windows 10
Python 3.7.0
Tensorflow 2.2.0
minerl 0.3.5
The text was updated successfully, but these errors were encountered:
prabhasak
changed the title
[Question] DeprecationWarning: DataPipeline.sarsd_iter method is deprecated! Request for update
[Question] cv2 error on using expert_dataset.py (follow-up from DeprecationWarning: DataPipeline.sarsd_iter)
Jul 10, 2020
Hello. There is a cv2 error on running any baseline code from
general/chainerrl/baselines
(after fixing this issue). Here's the traceback on running theGAIL.py
baseline:On tracing the issue, turns out what's fed into
self.observation_converter()
andself.action_converter()
variables has shape(1, 32, 64, 64, 3)
instead of(32, 64, 64, 3)
(introduced from the newDataPipeline.batch_iter(**1**, 32, 1)
)So, in both
observation_wrappers.py
andaction_wrappers.py
we need to ignore the first dim (usedict[keys][0]
instead ofdict[keys]
) and append the dim on return (return np.expand_dims(list, 0)
instead ofreturn list
). This seems to fix the problemNote:
dict
=observation, action
andlist
=ret, val
in the two files, respectivelyPS: If the spaces weren't
dict
, we could fix this by just initializing the converters aslambda x: x[0]
instead oflambda x: x
:vSystem Info
The text was updated successfully, but these errors were encountered: