models icon indicating copy to clipboard operation
models copied to clipboard

ImportError: No module named 'google3'

Open wpq3142 opened this issue 9 years ago • 4 comments

image

After this update, this problem occurs!

wpq3142 avatar Oct 30 '17 14:10 wpq3142

I am facing the same issue. anyone solves it? Thanks,

lyltencent avatar Oct 30 '17 15:10 lyltencent

i changed 'import googel'

wpq3142 avatar Oct 30 '17 15:10 wpq3142

import contextlib2 from google3.third_party.tensorflow_models.object_detection.dataset_tools import tf_record_creation_util

num_shards=7 output_filebase='train.record'

with contextlib2.ExitStack() as tf_record_close_stack: output_tfrecords = tf_record_creation_util.open_sharded_output_tfrecords( tf_record_close_stack, output_filebase, num_shards) for index, example in examples: tf_example = create_tf_example(example) output_shard_index = index % num_shards output_tfrecords[output_shard_index].write(tf_example.SerializeToString())

When I run above script.. It says no

Traceback (most recent call last): File "partsTrain.py", line 2, in from google3.third_party.tensorflow_models.object_detection.dataset_tools import tf_record_creation_util ImportError: No module named 'google3'

even I changed google3 to google.. I got this error

Traceback (most recent call last): File "partsTrain.py", line 2, in from google.third_party.tensorflow_models.object_detection.dataset_tools import tf_record_creation_util ImportError: No module named 'google.third_party'

any solution

faheemirfan avatar Oct 14 '18 18:10 faheemirfan

@faheemirfan I changed from google3.third_party.tensorflow_models.object_detection.dataset_tools import tf_record_creation_util to object_detection.dataset_tools import tf_record_creation_util Since object_detection is part of tensorflow/models/research and is in my PYTHONPATH the issue was fixed for me.

DanielFirmbach avatar Nov 28 '18 10:11 DanielFirmbach