models icon indicating copy to clipboard operation
models copied to clipboard

ImportError: cannot import name 'trainer'

Open Distance789 opened this issue 8 years ago • 6 comments

I installed the object detection API correctly in my windows using this https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.

under this instructioin.and I checked by running model_builder_test.py This gave me a OK result. and I run the demo ,it is OK too.

Then I moved on to running the train.py on my dataset using the following command

python train.py --logtostderr --pipeline_config_path=pipeline.config --train_dir=train_file

Got the following result:

ImportError Traceback (most recent call last) E:\raccoon_dataset-master\train.py in () 47 import tensorflow as tf 48 ---> 49 from object_detection import trainer 50 from object_detection.builders import dataset_builder 51 from object_detection.builders import graph_rewriter_builder

ImportError: cannot import name 'trainer'

Distance789 avatar Aug 01 '18 12:08 Distance789

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

tensorflowbutler avatar Aug 01 '18 19:08 tensorflowbutler

from object_detection/legacy import trainer can fix

irmowan avatar Aug 02 '18 06:08 irmowan

thank you ,I use from object_detection.legacy import trainer ,the problem solve

Distance789 avatar Aug 02 '18 08:08 Distance789

thank you ,I use from object_detection.legacy import trainer ,the problem solve

Can you give me the other version of object detection ?

EdwardVincentMa avatar Oct 12 '18 02:10 EdwardVincentMa

ImportError: cannot import name 'trainer' from 'object_detection.legacy' (C:\tensorflow1\models\research\object_detection\legacy_init_.py)

How can I fix this error

rejj1234 avatar Mar 11 '19 06:03 rejj1234

make sure all the original files from the legacy dir are still there (trainer.py for example)

ah3243 avatar Jul 31 '19 13:07 ah3243