sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 75 forks source link

No module named torch_utils.engine error while training #18

Closed Bleking closed 2 years ago

Bleking commented 2 years ago

Hello, I have been having some trouble training with the smoke custom dataset and I keep receiving the error below.

Traceback (most recent call last): File "train.py", line 10, in from torch_utils.engine import train_one_epoch, evaluate ImportError: No module named torch_utils.engine

The problem seems to have risen from the python version match, and I could not find exactly which python version is used for this whole code. The version in my enviroment is 3.10.4.

Thank you.

sovit-123 commented 2 years ago

@Bleking The Python version seems to be fine. The code supports Python 3.10.x. Were you able to successfully install all the requirements according to instructions? Also, it seems that is unable to locate the torch_utils.engine module which is odd. This is pretty odd. Can you share the following things:

  1. PyTorch version.
  2. Torchvision version.
  3. OS (Ubuntu/Windows)
  4. The complete command that you used.
Bleking commented 2 years ago

torch 1.12.0 torchvision 0.13.0 I ran it on MobaXTerm (Linux environment) python train.py --config data_configs/smoke.yaml --epochs 100 --model fasterrcnn_resnet50 --project-name smoke_training --batch-size 16

I used the very default command for the smoke dataset that you have provided us.

sovit-123 commented 2 years ago

If you are using Linux environment with CUDA already installed globally, please do pip install -r requirements.txt. Right now, the latest version of PyTorch, that is, PyTorch 1.12.0 is not supported because of some pretrained weight changes.