DLR-RM / BlenderProc

A procedural Blender pipeline for photorealistic training image generation
GNU General Public License v3.0
2.73k stars 444 forks source link

ModuleNotFoundError: No module named 'bop_toolkit_lib' #934

Closed ccteaher closed 1 year ago

ccteaher commented 1 year ago

Describe the issue

Hi, I have the same question

I installed blenderproc through the website, I ran blenderproc quickstart

and then installed blender3.3. Everything was a success.

I downloaded and installed bop_toolkit in my anaconda virtual environment using the following command:

git clone https://github.com/thodan/bop_toolkit
cd bop_toolkit
pip install -r requirements.txt -e .

I also installed bop_toolkit successfully

(ble) cc@ccPC:~/MyCode/BLENDER_PRO/BlenderProc-main$ git clone https://github.com/thodan/bop_toolkit
正克隆到 'bop_toolkit'...
remote: Enumerating objects: 1000, done.
remote: Counting objects: 100% (552/552), done.
remote: Compressing objects: 100% (153/153), done.
remote: Total 1000 (delta 480), reused 399 (delta 399), pack-reused 448
接收对象中: 100% (1000/1000), 369.84 KiB | 1015.00 KiB/s, 完成.
处理 delta 中: 100% (690/690), 完成.
(ble) cc@ccPC:~/MyCode/BLENDER_PRO/BlenderProc-main$ cd bop_toolkit
(ble) cc@ccPC:~/MyCode/BLENDER_PRO/BlenderProc-main/bop_toolkit$ pip install -r requirements.txt -e .
Obtaining file:///home/cc/MyCode/BLENDER_PRO/BlenderProc-main/bop_toolkit
  Preparing metadata (setup.py) ... done
Collecting git+https://github.com/MartinSmeyer/cocoapi.git@v1.0#subdirectory=PythonAPI (from -r requirements.txt (line 12))
  Cloning https://github.com/MartinSmeyer/cocoapi.git (to revision v1.0) to /tmp/pip-req-build-ej0kac7y
  Running command git clone --filter=blob:none --quiet https://github.com/MartinSmeyer/cocoapi.git /tmp/pip-req-build-ej0kac7y
  Running command git checkout -q b114069f17162f704f20de15bbb15838305e960e
  Resolved https://github.com/MartinSmeyer/cocoapi.git to commit b114069f17162f704f20de15bbb15838305e960e
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy==1.5.1 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.5.1)
Requirement already satisfied: kiwisolver==1.3.1 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (1.3.1)
Requirement already satisfied: matplotlib==2.2.4 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (2.2.4)
Requirement already satisfied: imageio==2.5.0 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (2.5.0)
Requirement already satisfied: pypng==0.0.19 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (0.0.19)
Requirement already satisfied: Cython==0.29.24 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (0.29.24)
Requirement already satisfied: PyOpenGL==3.1.0 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 7)) (3.1.0)
Requirement already satisfied: triangle>=20190115.2 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 8)) (20220202)
Requirement already satisfied: glumpy==1.1.0 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 9)) (1.1.0)
Requirement already satisfied: opencv-python>=4.3.0.36 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 10)) (4.8.0.74)
Requirement already satisfied: Pillow>=8.2.0 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 11)) (9.5.0)
Requirement already satisfied: vispy>=0.6.5 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 13)) (0.13.0)
Requirement already satisfied: webdataset in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 14)) (0.2.48)
Requirement already satisfied: numpy in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from -r requirements.txt (line 15)) (1.21.6)
Requirement already satisfied: pytz in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from matplotlib==2.2.4->-r requirements.txt (line 3)) (2023.3)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from matplotlib==2.2.4->-r requirements.txt (line 3)) (3.1.0)
Requirement already satisfied: cycler>=0.10 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from matplotlib==2.2.4->-r requirements.txt (line 3)) (0.11.0)
Requirement already satisfied: six>=1.10 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from matplotlib==2.2.4->-r requirements.txt (line 3)) (1.16.0)
Requirement already satisfied: python-dateutil>=2.1 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from matplotlib==2.2.4->-r requirements.txt (line 3)) (2.8.2)
Requirement already satisfied: setuptools>=18.0 in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from pycocotools==2.0->-r requirements.txt (line 12)) (65.6.3)
Requirement already satisfied: packaging in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from vispy>=0.6.5->-r requirements.txt (line 13)) (23.1)
Requirement already satisfied: freetype-py in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from vispy>=0.6.5->-r requirements.txt (line 13)) (2.4.0)
Requirement already satisfied: hsluv in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from vispy>=0.6.5->-r requirements.txt (line 13)) (5.0.3)
Requirement already satisfied: braceexpand in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from webdataset->-r requirements.txt (line 14)) (0.1.7)
Requirement already satisfied: pyyaml in /home/cc/anaconda3/envs/ble/lib/python3.7/site-packages (from webdataset->-r requirements.txt (line 14)) (6.0)
Installing collected packages: bop-toolkit-lib
  Running setup.py develop for bop-toolkit-lib
Successfully installed bop-toolkit-lib-1.0

But when I run this code Execute in the BlenderProc main directory: command creates 50K training images in BOP format for the given dataset:

blenderpoc run examples/datasets/bop_challenge/main_<bop_dataset_name>_<random/upright>.py
               <path_to_bop_data>
               resources/cctextures
               examples/datasets/bop_challenge/output
               --num_scenes=2000

I get the following result: ModuleNotFoundError: No module named 'bop_toolkit_lib'

(ble) cc@ccPC:~/MyCode/BLENDER_PRO/BlenderProc-main$ blenderproc run examples/datasets/bop_challenge/main_lm_upright.py BopDataset/dataset_lm cctextures examples/datasets/bop_challenge/output --num_scenes=3
Warning: Changed install path from /home_local/cc... to /home/cc..., there is no /home_local/ on this machine.
Using blender in /home/cc/blender/blender-3.3.0-linux-x64
Using temporary directory: /dev/shm/blender_proc_3c92f820204f436597f16db784656cdc
Blender 3.3.0 (hash 0759f671ce1f built 2022-09-07 00:16:43)
Read prefs: /home/cc/.config/blender/3.3/config/userpref.blend
Setting blender language settings to english during this run
Selecting render devices...
Device NVIDIA GeForce GTX 1650 Ti of type OPTIX found and used.
Device Genuine Intel CPU 0000 @ 2.10GHz of type CPU found and used.
bob: BopDataset/dataset_lm/lm, dataset_path: BopDataset/dataset_lm
dataset: lm
Error: Python: Traceback (most recent call last):
  File "/home/cc/MyCode/BLENDER_PRO/BlenderProc-main/examples/datasets/bop_challenge/main_lm_upright.py", line 16, in <module>
    target_bop_objs = bproc.loader.load_bop_objs(bop_dataset_path = os.path.join(args.bop_parent_path, 'lm'), mm2m = True)
  File "/home/cc/anaconda3/envs/ble/lib/python3.7/site-packages/blenderproc/python/loader/BopLoader.py", line 44, in load_bop_objs
    from bop_toolkit_lib import dataset_params
ModuleNotFoundError: No module named 'bop_toolkit_lib'

Error: script failed, file: 'examples/datasets/bop_challenge/main_lm_upright.py', exiting.
Cleaning temporary directory

So, what should I do to get the blendproc command to recognize the bop_toolkit_lib package I installed?

Minimal code example

No response

Files required to run the code

No response

Expected behavior

I expect to run the code in the bop challenge: command creates 50K training images in BOP format for the given dataset

but:

ModuleNotFoundError: No module named 'bop_toolkit_lib'

BlenderProc version

3.3.0

Bainily028 commented 11 months ago

Hello, I have encountered the same situation as you. How did you solve it in the end?

ccteaher commented 11 months ago

Hello, I have encountered the same situation as you. How did you solve it in the end?

Yes,I solve it

WHHHHY commented 5 months ago

I also met this problem,when i run calc_gt_masks.py,and How did you solve it in the end?Did you have any advice? Thx a lot

xhhhhhhh777 commented 5 months ago

咋解决的呀?

Elen3333 commented 2 months ago

您好 也遇到了同样问题 请问该如何解决呀!!?