ModuleNotFoundError: No module named 'common'


#1

Trying to fine-tune a model using directions from

Recieved the following error
/home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages/urllib3/contrib/pyopenssl.py:46: DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead
import OpenSSL.SSL
Traceback (most recent call last):
File “train.py”, line 6, in
from train.train_net import train_net
File “/home/ec2-user/SageMaker/mxnet-ssd/train/train_net.py”, line 12, in
from symbol.symbol_factory import get_symbol_train
File “/home/ec2-user/SageMaker/mxnet-ssd/symbol/symbol_factory.py”, line 3, in
from symbol import symbol_builder
File “/home/ec2-user/SageMaker/mxnet-ssd/symbol/symbol_builder.py”, line 2, in
from common import multi_layer_feature, multibox_layer
ModuleNotFoundError: No module named ‘common’

Here is my Jupyter notebook with the steps I have taken to fune tune the model


#2

Module common is here. Can you try this with Python 2 and let me know if that works? I’ve had problems in the past trying to run the SSD example using Python 3.


#3

Thanks, haven’t had a chance to try it yet but hopefully tonight I can and then I’ll report back.


#4

I switched to python 2.7 and now I am getting errors complaining about missing cv2
I pip installed opencv-python but the error is still there.

%%bash

cd ./mxnet-ssd/ && python3 train.py --gpus 0 --val-path ./data/val.rec --train-path ./data/train.rec --finetune 1 --end-epoch 40 --num-class 1 --data-shape 300 --class-names ‘text block’ --num-example 398 --label-width 74

Using mxnet as:
<module ‘mxnet’ (namespace)>
Warning: using pre-installed version of mxnet may cause unexpected error…
(export MXNET_EXAMPLE_SSD_DISABLE_PRE_INSTALLED=1) to prevent loading pre-installed mxnet.
Traceback (most recent call last):
File “train.py”, line 6, in
from train.train_net import train_net
File “/home/ec2-user/SageMaker/mxnet-ssd/train/train_net.py”, line 8, in
from dataset.iterator import DetRecordIter
File “/home/ec2-user/SageMaker/mxnet-ssd/dataset/iterator.py”, line 3, in
import cv2
ModuleNotFoundError: No module named ‘cv2’