Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named models when running on Google Colab #1

Open
CJavier11 opened this issue Jun 22, 2023 · 0 comments
Open

No module named models when running on Google Colab #1

CJavier11 opened this issue Jun 22, 2023 · 0 comments

Comments

@CJavier11
Copy link

Hello Vikas,
I've been running into the following error when trying to train my yolov7 model on google colab. Have you dealt with a similar issue/gotten this process to work in colab?
Thanks,
Chris

github: skipping check (not a git repository)
requirements: /root/requirements.txt not found, check failed.

ModuleNotFoundError Traceback (most recent call last)
in <cell line: 1>()
----> 1 tiny_yolo.create_optimized_model()

5 frames
/usr/local/lib/python3.10/dist-packages/modoptima-0.1.0-py3.10.egg/modoptima/MasterTrainer.py in create_optimized_model(self)
83
84 def create_optimized_model(self):
---> 85 self.main_class.create_optimized_model()
86
87 def export_model(self,weights='./optmodel/exp/best.pt',

/usr/local/lib/python3.10/dist-packages/modoptima-0.1.0-py3.10.egg/modoptima/Train/yolov7tiny/Trainer.py in create_optimized_model(self)
949 total_batch_size=self.total_batch_size,save_dir=self.save_dir,world_size=self.world_size,global_rank=self.global_rank,img_size=self.img_size)
950
--> 951 self.start_training(hyp,self.opt,device, tb_writer)
952
953 # Evolve hyperparameters (optional)

/usr/local/lib/python3.10/dist-packages/modoptima-0.1.0-py3.10.egg/modoptima/Train/yolov7tiny/Trainer.py in start_training(self, hyp, opt, device, tb_writer)
398 if rank in [-1, 0]:
399 opt.hyp = hyp # add hyperparameters
--> 400 run_id = torch.load(weights, map_location=device).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None
401 wandb_logger = WandbLogger(opt, Path(opt.save_dir).stem, run_id, data_dict)
402 loggers['wandb'] = wandb_logger.wandb

/usr/local/lib/python3.10/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, weights_only, **pickle_load_args)
787 except RuntimeError as e:
788 raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
--> 789 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
790 if weights_only:
791 try:

/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _load(zip_file, map_location, pickle_module, pickle_file, **pickle_load_args)
1129 unpickler = UnpicklerWrapper(data_file, **pickle_load_args)
1130 unpickler.persistent_load = persistent_load
-> 1131 result = unpickler.load()
1132
1133 torch._utils._validate_loaded_sparse_tensors()

/usr/local/lib/python3.10/dist-packages/torch/serialization.py in find_class(self, mod_name, name)
1122 pass
1123 mod_name = load_module_mapping.get(mod_name, mod_name)
-> 1124 return super().find_class(mod_name, name)
1125
1126 # Load the data (which may in turn use persistent_load to load tensors)

ModuleNotFoundError: No module named 'models'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant