Yinyf0804 / CBL-WSOD

11 stars 1 forks source link

ModuleNotFoundError: No module named 'resource' #4

Open cpy0029 opened 7 months ago

cpy0029 commented 7 months ago

ModuleNotFoundError: No module named 'resource' How to solve?

roudancongya commented 6 months ago

I had the same problem. Did you solve it?

Yinyf0804 commented 6 months ago

You can try: pip install python-resources to install it.

roudancongya commented 6 months ago

Thank you very much. I have handled the issue of resources, but there is a new problem and I cannot find module named 'utils.cython_bbox',This module I did not find in the utils directory,I made sure I installed all the dependencies

You can try: to install it.pip install python-resources

Yinyf0804 commented 6 months ago

The file is in lib/utils/cython_bbox.pyx. Can you show me the error report?

roudancongya commented 6 months ago

The file is in lib/utils/cython_bbox.pyx. Can you show me the error report?

This is my error report:

Traceback (most recent call last): File "D:\anaconda\envs\CBL\lib\code.py", line 91, in runcode exec(code, self.locals) File "", line 9, in File "D:\pycharm\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) File "D:\pycharm,work\CBL\CBL-WSOD-main\lib\datasets\roidb.py", line 27, in import utils.boxes as box_utils File "D:\pycharm\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pycharm,work\CBL\CBL-WSOD-main\lib\utils\boxes.py", line 54, in import utils.cython_bbox as cython_bbox File "D:\pycharm\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) ModuleNotFoundError: No module named 'utils.cython_bbox'

roudancongya commented 6 months ago

Is it because my environment is windows11 and not linux?

Yinyf0804 commented 6 months ago

Is it because my environment is windows11 and not linux?

I'm not so sure about this, since I run the code only on linux. Maybe you can delete the pycache folder and try it again, or import the relative path such as "import cython_bbox".

roudancongya commented 6 months ago

Is it because my environment is windows11 and not linux?

我对此不太确定,因为我只在 linux 上运行代码。也许你可以删除pycache文件夹再试一次,或者导入相对路径,比如“import cython_bbox”。

Thank you for your reply,I'll try to run this code on linux to see if I have the same problem

roudancongya commented 4 months ago

Is it because my environment is windows11 and not linux?

I'm not so sure about this, since I run the code only on linux. Maybe you can delete the pycache folder and try it again, or import the relative path such as "import cython_bbox".

Hello, recently I have restarted the work of replicating your paper and this time we have run your code on Linux system,but now there's a problem that I don't have pre-train model, and pre-train weights(vgg16_caffe.pth), because your links seem to be broken.

roudancongya commented 4 months ago

Now there is a new error problem, the following is my error information: Traceback (most recent call last): File "/home/student/anaconda3/envs/CBL/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 349, in del self._shutdown_workers() File "/home/student/anaconda3/envs/CBL/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 328, in _shutdown_workers self.worker_result_queue.get() File "/home/student/anaconda3/envs/CBL/lib/python3.6/multiprocessing/queues.py", line 337, in get return _ForkingPickler.loads(res) File "/home/student/anaconda3/envs/CBL/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 70, in rebuild_storage_fd fd = df.detach() File "/home/student/anaconda3/envs/CBL/lib/python3.6/multiprocessing/resource_sharer.py", line 57, in detach with _resource_sharer.get_connection(self._id) as conn: File "/home/student/anaconda3/envs/CBL/lib/python3.6/multiprocessing/resource_sharer.py", line 87, in get_connection c = Client(address, authkey=process.current_process().authkey) File "/home/student/anaconda3/envs/CBL/lib/python3.6/multiprocessing/connection.py", line 487, in Client c = SocketClient(address) File "/home/student/anaconda3/envs/CBL/lib/python3.6/multiprocessing/connection.py", line 614, in SocketClient s.connect(address) ConnectionRefusedError: [Errno 111] Connection refused