Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello i have question #21

Open
LEEGILJUN opened this issue Apr 23, 2020 · 0 comments
Open

hello i have question #21

LEEGILJUN opened this issue Apr 23, 2020 · 0 comments

Comments

@LEEGILJUN
Copy link

good day!
i found when i test your cord
look at the error massege
occurred some error
in Configuring a Training Pipeline

AttributeError Traceback (most recent call last)
in ()
1 import re
----> 2 num_classes = get_num_classes(label_map_pbtxt_fname)
3 filename = '/content/models/research/object_detection/samples/configs/faster_rcnn_inception_v2_pets.config'
4 with open(pipeline_fname) as f:
5 s = f.read()

1 frames
/content/models/research/object_detection/utils/label_map_util.py in load_labelmap(path)
136 a StringIntLabelMapProto
137 """
--> 138 with tf.gfile.GFile(path, 'r') as fid:
139 label_map_string = fid.read()
140 label_map = string_int_label_map_pb2.StringIntLabelMap()

AttributeError: module 'tensorflow' has no attribute 'gfile'

`import re
num_classes = get_num_classes(label_map_pbtxt_fname)
filename = '/content/models/research/object_detection/samples/configs/faster_rcnn_inception_v2_pets.config'
with open(pipeline_fname) as f:
s = f.read()
with open(pipeline_fname, 'w') as f:

# fine_tune_checkpoint
s = re.sub('fine_tune_checkpoint: ".*?"',
           'fine_tune_checkpoint: "{}"'.format(fine_tune_checkpoint), s)

# tfrecord files train and test.
s = re.sub(
    '(input_path: ".*?)(train.record)(.*?")', 'input_path: "{}"'.format(train_record_fname), s)
s = re.sub(
    '(input_path: ".*?)(val.record)(.*?")', 'input_path: "{}"'.format(test_record_fname), s)

# label_map_path
s = re.sub(
    'label_map_path: ".*?"', 'label_map_path: "{}"'.format(label_map_pbtxt_fname), s)

# Set training batch_size.
s = re.sub('batch_size: [0-9]+',
           'batch_size: {}'.format(batch_size), s)

# Set training steps, num_steps
s = re.sub('num_steps: [0-9]+',
           'num_steps: {}'.format(num_steps), s)

# Set number of classes num_classes.
s = re.sub('num_classes: [0-9]+',
           'num_classes: {}'.format(num_classes), s)
f.write(s)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant