mdistiller icon indicating copy to clipboard operation
mdistiller copied to clipboard

ModuleNotFoundError: No module named 'mdistiller'

Open kennysH opened this issue 1 year ago • 5 comments

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 avatar Dec 08 '23 08:12 kennysH

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

kennysH avatar Dec 08 '23 09:12 kennysH

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.

JinYu1998 avatar Dec 21 '23 17:12 JinYu1998

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!

kennysH avatar Jan 02 '24 07:01 kennysH

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

genglufneg avatar Apr 20 '24 15:04 genglufneg

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

JinYu1998 avatar Apr 20 '24 15:04 JinYu1998