ModuleNotFoundError: No module named 'engine'

When I executed the source code.

The code is from the tutorial

It said that:

(base) [yq@local pytorch-examples]$python3
Traceback (most recent call last):
  File "", line 13, in <module>
    from engine import train_one_epoch, evaluate
ModuleNotFoundError: No module named 'engine'

I don’t know which package is called ‘engine’ here.

From the tutorial:

In references/detection/ , we have a number of helper functions to simplify training and evaluating detection models. Here, we will use references/detection/ , references/detection/ and references/detection/ . Just copy them to your folder and use them here.


So how do we get the references/detection/ folders? What should we download and install? I have installed the pytorch, torchvision in my environment, but I could not find those files. Thanks

You could copy/paste these files fro the torchvision repository or clone it locally.

1 Like

git clone
git clone
In vision/references/detection: copy all .py file to [] directory
Copy cocoapi/PythonAPI/pycocotools to [] directory