Open mKabouri opened 1 month ago
Hi,
I encountered the same issue. This issue occurs if you use Python 3.9 or above. It will not happen if you change your version to Python 3.8 or below.
Hi,
After switching to Python 3.8, the initial problem was resolved, but I encountered a new issue. When I ran ./run_kitchen-FloorPlan21_0.sh
, I received the error below.
When investigating, I found that the bounding box output has an area of 0, meaning the (x1, y1)
and (x2, y2)
coordinates of the bounding box have the same values. As a result, in thortils.vision.projection.thor_project_bbox(...)
, the length of positions
is 0. Have you encountered this issue before ?
Traceback (most recent call last):
File "trial_runner.py", line 54, in <module>
main()
File "trial_runner.py", line 29, in main
results = trial.run(logging=args.logging)
File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/trial.py", line 159, in run
observation, reward = task_env.execute(agent, action)
File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/common.py", line 83, in execute
observation = self.get_observation(event, action, detector=agent.detector)
File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/object_search.py", line 211, in get_observation
detections = detector.detect_project(img, event.depth_frame,
File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/detector.py", line 264, in detect_project
thor_points = pj.thor_project_bbox(
File "/home/mykabouri/Desktop/cos-pomdp/venv/cosp/lib/python3.8/site-packages/thortils/vision/projection.py", line 302, in thor_project_bbox
sampled_positions = positions[np.random.choice(len(positions), num_points)]
File "mtrand.pyx", line 928, in numpy.random.mtrand.RandomState.choice
ValueError: a must be greater than 0 unless no samples are taken
Hi,
After switching to Python 3.8, the initial problem was resolved, but I encountered a new issue. When I ran
./run_kitchen-FloorPlan21_0.sh
, I received the error below.When investigating, I found that the bounding box output has an area of 0, meaning the
(x1, y1)
and(x2, y2)
coordinates of the bounding box have the same values. As a result, inthortils.vision.projection.thor_project_bbox(...)
, the length ofpositions
is 0. Have you encountered this issue before ?Traceback (most recent call last): File "trial_runner.py", line 54, in <module> main() File "trial_runner.py", line 29, in main results = trial.run(logging=args.logging) File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/trial.py", line 159, in run observation, reward = task_env.execute(agent, action) File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/common.py", line 83, in execute observation = self.get_observation(event, action, detector=agent.detector) File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/object_search.py", line 211, in get_observation detections = detector.detect_project(img, event.depth_frame, File "/home/mykabouri/Desktop/cos-pomdp/cospomdp_apps/thor/detector.py", line 264, in detect_project thor_points = pj.thor_project_bbox( File "/home/mykabouri/Desktop/cos-pomdp/venv/cosp/lib/python3.8/site-packages/thortils/vision/projection.py", line 302, in thor_project_bbox sampled_positions = positions[np.random.choice(len(positions), num_points)] File "mtrand.pyx", line 928, in numpy.random.mtrand.RandomState.choice ValueError: a must be greater than 0 unless no samples are taken
You might want to try a lower version of Numpy as well - either 1.20 or 1.24
Thank you for your response. I do not think this is an issue with numpy (I am using version 1.24). The positions
array is empty due to an unusual bounding box prediction, where the bounding box predicts a single point (x1 == x2
and y1 == y2
).
Thank you for your response. I do not think this is an issue with numpy (I am using version 1.24). The
positions
array is empty due to an unusual bounding box prediction, where the bounding box predicts a single point (x1 == x2
andy1 == y2
).
Oh ok makes sense. I guess in that case you might just ignore that case since the object prediction has 0 width or 0 height.
Hi,
I am trying to reproduce the results from the cos-pomdp experiments, specifically tables 1 and 2 from the paper. Here's the process I followed:
I went to
experiments/thor
.I ran
python collect_correlation_info.py
followed bypython experiment_thor.py
. This generated theExperimentThor-...
folder inresults
folder.I trained yolov5 using the provided data.
I returned to the
ExperimentThor-...
directory and executed the script./run_kitchen-FloorPlan21_0.sh
(I assume I need to run all the scripts and then usepython gather_results.py
to reproduce the tables ?).However, when running the script, I encountered the following error, which seems to originate from
pomdp_py
:Thank you!