Gengzigang / PCT

This is an official implementation of our CVPR 2023 paper "Human Pose as Compositional Tokens" (https://arxiv.org/pdf/2303.11638.pdf)
MIT License
311 stars 20 forks source link

Module not found error! #34

Open JasOleander opened 5 months ago

JasOleander commented 5 months ago

user/PCT/tools/train.py", line 19, in from models import build_posenet ModuleNotFoundError: No module named 'models'

I face with this issue although there is a models folder under PCT. How can fix it?

bit-scientist commented 1 month ago

@JasOleander did you have any success on that? I got the same error.

@Gengzigang , could you upload all necessary files ?

bit-scientist commented 1 month ago

@JasOleander Turns out, on Windows machine you must do what PYTHONPATH="$(dirname $0)/..":$PYTHONPATH does in Linux machine. This command updates the python path to include the parent directory since the script itself is one-level down. If you're on Windows do the following:

set "SCRIPT_DIR=C:\path\to\your\PCT\vis_tools\demo_img_with_mmdet.py"
set "PARENT_DIR=%SCRIPT_DIR%\.."
set "PYTHONPATH=%PARENT_DIR%;%PYTHONPATH%"

Then run the command: python vis_tools/demo_img_with_mmdet.py vis_tools/cascade_rcnn_x101_64x4d_fpn_coco.py https://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_rcnn_x101_64x4d_fpn_20e_coco/cascade_rcnn_x101_64x4d_fpn_20e_coco_20200509_224357-051557b1.pth configs/pct_[base/large/huge]_classifier.py weights/pct/swin_[base/large/huge].pth --img-root images/ --img your_image.jpg --out-img-root images/ --thickness 2

JasOleander commented 1 month ago

@bit-scientist when install mmcv, is it mmcv-full or mmcv==1.7.0? When I run above line you mentioned, I got this error ModuleNotFoundError: No module named 'mmcv._ext'. could you tell your mmcv, mmdet, mmpose version?

bit-scientist commented 1 month ago

@JasOleander, sure. Note that I created a conda env on Windows machine. Here you are:

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
pip install mmpose==0.29.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
pip install tqdm yacs scikit-learn tensorboardX pycocotools timm albumentations
pip install mmdet==2.27.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
JasOleander commented 1 month ago

@bit-scientist Thank you so much for your reply. Your reply support me a lot. The main problem is cuda version of me. Now, I can run by your support. By the way, have you ever been trained the tokenizer? How much time taken for training?

bit-scientist commented 1 month ago

@JasOleander I haven't trained it and have no plan either. Because the model works quite well.