Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError #1

Closed
Jasonleeo-cpu opened this issue Aug 8, 2021 · 8 comments
Closed

AssertionError #1

Jasonleeo-cpu opened this issue Aug 8, 2021 · 8 comments

Comments

@Jasonleeo-cpu
Copy link

Jasonleeo-cpu commented Aug 8, 2021

When I run the command for evaluation:the error shows is :**Traceback (most recent call last):
File "evaluate_generator.py", line 98, in assert not os.path.exists(grippers_directory),AssertionError*rHow can I solve it ?Could anyone can help me for some details ?Thanks in advance!

@Jasonleeo-cpu Jasonleeo-cpu changed the title ValueError: num_samples should be a positive integer value, but got num_samples=0 AssertionError Aug 9, 2021
@submagr
Copy link
Contributor

submagr commented Aug 19, 2021

Hi @Jasonleeo-cpu, this error says that the evaluation directory already evaluation_results already exist. In order to run it successfully, either rename evaluate_results directory or provide a different --name argument when you run the command.

@Jasonleeo-cpu
Copy link
Author

Hi @submagr ,if I delete the evaluate_results directory ,it shows that error also.I don't know whether because I change all the shuffle into True of utils.py or not ,if I don't change that ,the results shows as follows:
File "/home/lee/anaconda3/envs/fit2form/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 96, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0

Could you give more details for running this project?Such as where should I place the data in order to this project can read it directly?Thanks

@Bailey-24
Copy link

Hi,@submagr ,Would you please provide the "graspobject_test_all.txt"

In the evaluate_generator.pyline95, there are no "graspobject_test_all.txt" file existing in the project.

@Bailey-24
Copy link

Bailey-24 commented Mar 24, 2022

Hi @submagr ,I have the question.
When I ran the command python evaluate_generator.py --evaluate_config configs/evaluate.json --objects test/ --name evaluation_results
And I got this
pybullet build time: Oct 8 2020 00:10:46 2022-03-24 22:02:28,609 INFO resource_spec.py:212 -- Starting Ray with 3.56 GiB memory available for workers and up to 1.79 GiB for objects. You can adjust these settings with ray.init(memory=<bytes>, object_store_memory=<bytes>). 2022-03-24 22:02:28,991 INFO services.py:1170 -- View the Ray dashboard at localhost:8265 configs/default.json [ObjectDataset] globbing grasp objects ... [ObjectDataset] found 0 objects checking grasp objects...: 0it [00:00, ?it/s] [ObjectDataset] found 0 bad objects Traceback (most recent call last): File "evaluate_generator.py", line 95, in <module> grasp_object_file="graspobject_test_all.txt", File "/run_code/fit2form-master/learning/utils.py", line 75, in __init__ collate_fn=lambda batch: batch) File "/home/pi/anaconda3/envs/fit2form/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 224, in __init__ sampler = RandomSampler(dataset, generator=generator) File "/home/pi/anaconda3/envs/fit2form/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 96, in __init__ "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0

Even though I have changed the argument of --name.
Would you please help me out. Thanks in advanced.

Hi @Jasonleeo-cpu, this error says that the evaluation directory already evaluation_results already exist. In order to run it successfully, either rename evaluate_results directory or provide a different --name argument when you run the command.

@submagr
Copy link
Contributor

submagr commented Mar 25, 2022

Hi @Bailey-24,
I have updated the test dataset URl in README.md.
Please delete the old test folder and run the following wget command again:
wget -qO- https://fit2form.cs.columbia.edu/downloads/data/test.tar.xz | tar xvfJ -

After downloading the new test folder, you should not see the above error.

Also please note that currently after downloading the checkpoints, they reside inside the project root. The code expects the checkpoints inside the directory downloads/checkpoints/. Please create these directories manually and move all the checkpoints *.pth files inside downloads/checkpoints.

@Bailey-24
Copy link

Bailey-24 commented Mar 25, 2022

Hi, @submagr , thank you for your reply and help, I'm very appreciate it.

I have successfully ran the python evaluate_generator.py --evaluate_config configs/evaluate.json --objects test/ --name evaluation_results on the google colab

I have tried my best to figure out how the project work , but I still got some problem ,

  1. Why the generated fingers only have the left side ?
    Because in the my evaluation_results, there are 000001_left.obj to 005091_left.obj files. But I got none of right side fingers.
    Here are my evaluation_results: https://drive.google.com/drive/folders/10s_BFFomOsCOTct_zAllHs0CGM_95XFG?usp=sharing

  2. Why all the results show like this?
    Results summary fit2form: base_connected: 1.0000 created_grippers_failed: 1.0000 single_connected_component: nan success: 0.0000 stability_1: 0.0000 stability_2: 0.0000 stability_3: 0.0000 stability_4: 0.0000 robustness_0: 0.0000 robustness_1: 0.0000 robustness_2: 0.0000 robustness_3: 0.0000 robustness_4: 0.0000 robustness_5: 0.0000 saved results at evaluation_results/val_results.npz fit2form: 18% 7/40 [06:55<56:47, 103.26s/it](pid=5349)

    In the val_results of val_results.npz , there are no difference like above.
    More detailed results can found in my google colab
    https://colab.research.google.com/drive/1PdHm3Mt5U94t11HxzlyauQFVu7DwqJCh?usp=sharing

  3. Would you please give me some advice about which object correspond to which fingers.
    Because I find the generated fingers doesn't in the order of object of test folder.

I will appreciate it if you could give me some advice. Looking forward for your reply. Thanks in advanced.

@submagr
Copy link
Contributor

submagr commented Apr 3, 2022

Hi @Bailey-24,
I ran the evaluate_generator.py file locally and it is running as expected. I debugged your collab notebook and it seems like the ray distributed programming library is causing issues while being run inside google colab.

I am working on creating a working collab notebook without ray integration but meanwhile, you can try one of the following two options:

  • Do not run on google collab. Even if you don't have a machine with GPU, you can run commands like CUDA_VISIBLE_DEVICES=-1 python evaluate_generator.py ..... Since this is only evaluation, without GPU should not be too slow.
  • If you absolutely need google collab, try running the following command with num_processes argument changed to 1:
    python evaluate_generator.py --evaluate_config configs/evaluate.json --objects test/ --name evaluation_results --num_processes=1

@Bailey-24
Copy link

Thank you for your reply. @submagr
I successfully evaluate the result.

But I still have some problem in #3 .
Thank you.

@submagr submagr closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants