megvii-research / mdistiller

The official implementation of [CVPR2022] Decoupled Knowledge Distillation https://arxiv.org/abs/2203.08679 and [ICCV2023] DOT: A Distillation-Oriented Trainer https://openaccess.thecvf.com/content/ICCV2023/papers/Zhao_DOT_A_Distillation-Oriented_Trainer_ICCV_2023_paper.pdf
792 stars 121 forks source link

ModuleNotFoundError: No module named 'mdistiller' #55

Open kennysH opened 10 months ago

kennysH commented 10 months ago

I encountered an error when running train.py after following the steps provided in the README for installation. The error message I received is: “Traceback (most recent call last): File "tools/train.py", line 9, in from mdistiller.models import cifar_model_dict, imagenet_model_dict, tiny_imagenet_model_dict ModuleNotFoundError: No module named 'mdistiller'.”

However, I can navigate to 'mdistiller.models' correctly in my IDE. Can you please tell me what might be the reason for this issue?"

kennysH commented 10 months ago

I noticed that after executing 'sudo python3 setup.py develop,' the path was not added to sys.path

JinYu1998 commented 9 months ago

I noticed that after executing 'sudo python3 setup.py develop,' the path was not added to sys.path

I had the same problem, and here's how I solved it. sudo pip install YOUR_Mdistiller_Path -t YOUR/Conda/env/lib/pythonX.X/site-packages

and I modiyf the train.py's pretrain_model_path to The real location of my teacher model !!!

I hope this helps, this problem took me an hour to solve.

kennysH commented 9 months ago

I noticed that after executing 'sudo python3 setup.py develop,' the path was not added to sys.path

I had the same problem, and here's how I solved it. sudo pip install YOUR_Mdistiller_Path -t YOUR/Conda/env/lib/pythonX.X/site-packages

and I modiyf the train.py's pretrain_model_path to The real location of my teacher model !!!

I hope this helps, this problem took me an hour to solve.

thank you a lot! The solution worked for me too!

genglufneg commented 5 months ago

I noticed that after executing 'sudo python3 setup.py develop,' the path was not added to sys.path

I had the same problem, and here's how I solved it. sudo pip install YOUR_Mdistiller_Path -t YOUR/Conda/env/lib/pythonX.X/site-packages

and I modiyf the train.py's pretrain_model_path to The real location of my teacher model !!!

I hope this helps, this problem took me an hour to solve.

Hello, I have the same question, but I have been trained on colab and I can't understand your answer. Could you tell me more details

JinYu1998 commented 5 months ago

I noticed that after executing 'sudo python3 setup.py develop,' the path was not added to sys.path

I had the same problem, and here's how I solved it. sudo pip install YOUR_Mdistiller_Path -t YOUR/Conda/env/lib/pythonX.X/site-packages and I modiyf the train.py's pretrain_model_path to The real location of my teacher model !!! I hope this helps, this problem took me an hour to solve.

Hello, I have the same question, but I have been trained on colab and I can't understand your answer. Could you tell me more details

Hello, There 2 ways to slove the problem.

  1. Please read my previous reply carefully, I believe this approach is helpful.
  2. You can use a previous version of the code by running git checkout 7bb7dd670f3ee3dd2500b89a8bb4c52c2a2df425 and sudo python3 setup.py develop