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

ModuleNotFoundError: No module named 'point_rend' #2

Closed
Kana-alt opened this issue Jun 29, 2021 · 11 comments
Closed

ModuleNotFoundError: No module named 'point_rend' #2

Kana-alt opened this issue Jun 29, 2021 · 11 comments

Comments

@Kana-alt
Copy link

I ran
python mask.py pika path-to-detectron2-root; cd -

The following error has occurred. How can I solve this problem?

Traceback (most recent call last):
File "mask.py", line 45, in
import point_rend
ModuleNotFoundError: No module named 'point_rend'
/home/shiori/lasr-main

@gengshan-y
Copy link
Collaborator

gengshan-y commented Jun 29, 2021

To predict segmentations, you need to clone detectron2 and replace path-to-detectron2-root as the root folder of detectron2 repo in this command.

Please see the updated instruction

@Kana-alt
Copy link
Author

Thanks for the reply.
I did as you said.
However, I get the same error.

I've also checked the torch and CUDA versions.
I have installed detectron2 correctly.
What could be the cause?

@gengshan-y
Copy link
Collaborator

This line adds the point_rend module to the python path. Could you check whether 'path-to-detectron2-folder/projects/PointRend/' exists?

@gengshan-y
Copy link
Collaborator

I updated the way of importing point_rend module to be independent of the detectron repo, but you still need to pass the repo path in order to read the model config files correctly.

@Kana-alt
Copy link
Author

Kana-alt commented Jun 30, 2021

'path-to-detectron2-folder/projects/PointRend/
does exist.

When I ran the updated code, I got the following error.
The file pointed to as non-existent by this error exists in the correct location.

Traceback (most recent call last):
File "mask.py", line 49, in
cfg.merge_from_file('%s/projects/PointRend/configs/InstanceSegmentation/pointrend_rcnn_X_101_32x8d_FPN_3x_coco.yaml'%(detbase))
File "/home/shiori/lasr-main/detectron2/detectron2/config/config.py", line 30, in merge_from_file
assert PathManager.isfile(cfg_filename), f"Config file '{cfg_filename}' does not exist!"
AssertionError: Config file './detectron2/projects/PointRend/configs/InstanceSegmentation/pointrend_rcnn_X_101_32x8d_FPN_3x_coco.yaml' does not exist!
/home/kana/lasr-main

@gengshan-y
Copy link
Collaborator

gengshan-y commented Jun 30, 2021

Are you able to
ls ./detectron2/projects/PointRend/configs/InstanceSegmentation/pointrend_rcnn_X_101_32x8d_FPN_3x_coco.yaml?

I guess you may have cloned detectron2 to the root folder of lasr, but did not pass detectron2 dir relative to where the command is executed.

@Kana-alt
Copy link
Author

I couldn't run "ls".

I'm sorry.
I don't really understand what you mean, but where is the right place to clone it?

@gengshan-y
Copy link
Collaborator

If you cloned detectron2 to ./lasr/detectron2, you could cd into ./preprocess, and then run
'python mask.py pika ../detectron2'

The point was to pass the relative path of detectron2 wrt the current folder to mask.py.

@Kana-alt
Copy link
Author

Thank you very much.
The problem has been solved.

By the way, where would I have cloned dentron2 to run with the original code?

Also, the first "log" and "tmp" files I created still do not contain anything, is that correct?

"python mask.py pika . After running "python mask.py pika ... /detectron2", the segmentation image is not generated.

@gengshan-y
Copy link
Collaborator

It generates data in subfolders under lasr-root/database/DAVIS/

@Kana-alt
Copy link
Author

Kana-alt commented Jul 1, 2021

Thank you! The problem has been solved.

@Kana-alt Kana-alt closed this as completed Jul 1, 2021
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

2 participants