alexfrom0815 / Online-3D-BPP-PCT

Code implementation of "Learning Efficient Online 3D Bin Packing on Packing Configuration Trees". We propose to enhance the practical applicability of online 3D Bin Packing Problem (BPP) via learning on a hierarchical packing configuration tree which makes the deep reinforcement learning (DRL) model easy to deal with practical constraints and well-performing even with continuous solution space.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'PctDiscrete-v0'

amket2310 opened this issue · comments

Dear authors,
while executing the main.py on a CPU mode, i get this error : "KeyError: 'PctDiscrete-v0' ", i was wondering if you could help me with this. sincerely
I'm turning the code on win10, python 3.7, gym==0.15.7, torch == 1.10.1
This is the Traceback :
Traceback (most recent call last):
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\site-packages\gym\envs\registration.py", line 132, in spec
return self.env_specs[id]
KeyError: 'PctDiscrete-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\aketfi\Online-3D-BPP-PCT\wrapper\shmem_vec_env.py", line 131, in _subproc_worker
env = env_fn_wrapper.x()
File "C:\Users\aketfi\Online-3D-BPP-PCT\envs.py", line 46, in _thunk
sample_right_bound = args.sample_right_bound
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\site-packages\gym\envs\registration.py", line 156, in make
return registry.make(id, **kwargs)
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\site-packages\gym\envs\registration.py", line 100, in make
spec = self.spec(path)
File "C:\Users\aketfi\Anaconda3\envs\3Dpacking\lib\site-packages\gym\envs\registration.py", line 142, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))

Hello, 'PctDiscrete-v0' will be registered in the ‘registration_envs()’ function in the 'tool.py' and found by gym during the environment creation process. Your error message shows that 'PctDiscrete-v0' was not registered successfully, my suggestion is to check if 'registration_envs' is running correctly, best wishes!

Hello,
Thank you for the respond, i have checked if the environment has been registered with :

from gym import envs
all_envs = envs.registry.all()

and it's showing that it was correctly registered.
so the problem is not in the function "registration_envs()"

Hello, Thank you for the respond, i have checked if the environment has been registered with :

from gym import envs
all_envs = envs.registry.all()

and it's showing that it was correctly registered. so the problem is not in the function "registration_envs()"

I am pretty sorry, I cannot figure out where the problem happens since I usually run this repo on the Ubunutu os. >_<

I have figurred out that the issue was that windows 10 is not compatible with gym.
I had to run the code on a Ubuntu VM .
Thank you for your answers, i just have one last question about the evaluation. can you explain to me what are the paramaters used of the evaluation ( i have problem to understand what's an episod ratio ) and i want to add a function that can visualize the result of the algorithm ( bin filled with items ) but i can't find the file that can keep this information.
Thank you in advance for your answers

(1) episode ratio means space utilization for one test sequence (episode means one test sequence for RL).
(2) To visualize the result, you can change the 'step' function in 'bin3D.py' and save the information you need.
Best wishes!