dengsutao / glsan

17 stars 3 forks source link

reimplementation #3

Open mahilaMoghadami opened 1 year ago

mahilaMoghadami commented 1 year ago

hello thank you for implementation sharing

I install pytorch and then build detectrone 2 which finished with this message: "Successfully built detectron2 fvcore antlr4-python3-runtime"

now I want to crop VisDrone dataset for SARS with crop_dataset.py but I get this error:

Traceback (most recent call last): File "/content/glsan/tools/crop_dataset.py", line 16, in from glsan.data import * ModuleNotFoundError: No module named 'glsan'

appreciate if help me. thank you.

Jayce0625 commented 1 year ago

You need to keep the workspace in the root of this project, for example: ... /glsan$ python tools/crop_dataset.py

mahilaMoghadami commented 1 year ago

hello again Im in glsan root: image

but error still persists.

Jayce0625 commented 1 year ago

Hello, I'm really sorry for taking so long to reply. I'm not a native English speaker, so please bear with me if I make some mistakes. For this kind of problem, I think it has something to do with your python path, you can check the web about "write self-built packages to Python sys.path", here all the self-built packages are xxx in your error "No name module xxx". Alternatively, you can try to add the paths directly by using code, which you can add at the beginning of the crop_dataset.py file:

import sys
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)
print(f"Module select dirs are: {sys.path}")

If there is still a problem, please let me know again.

mahilaMoghadami commented 1 year ago

thank you for your response. I solved my problem by adding :

import sys sys.path.append('/GLSAN/glsan/glsan/data')

Jayce0625 commented 1 year ago

Congratulations bro!