Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

python - Google Collab:[Errno 2] No such file or directory: 'Tensorflow/workspace/annotations\label_map.pbtxt'

I'm trying to do an object detection project using tensorflow and this is stopping me since 3 days.

WORKSPACE_PATH = 'Tensorflow/workspace'
SCRIPTS_PATH = 'Tensorflow/scripts'
APIMODEL_PATH = 'Tensorflow/models'
ANNOTATION_PATH = WORKSPACE_PATH+'/annotations'
IMAGE_PATH = WORKSPACE_PATH+'/images'
MODEL_PATH = WORKSPACE_PATH+'/models'
PRETRAINED_MODEL_PATH = WORKSPACE_PATH+'/pre-trained-models'
CONFIG_PATH = MODEL_PATH+'/my_ssd_mobnet/pipeline.config'
CHECKPOINT_PATH = MODEL_PATH+'/my_ssd_mobnet/'

This got compiled.

labels = [{'name':'A', 'id':1}, 
          {'name':'B', 'id':2},
          {'name':'C', 'id':3},
          {'name':'D', 'id':4},
          {'name':'E', 'id':5},
          {'name':'F', 'id':6},
          {'name':'G', 'id':7},
          {'name':'H', 'id':8},
          {'name':'I', 'id':9},
          {'name':'K', 'id':10},
          {'name':'L', 'id':11},
          {'name':'M', 'id':12},
          {'name':'N', 'id':13},
          {'name':'O', 'id':14},
          {'name':'P', 'id':15},
          {'name':'Q', 'id':16},
          {'name':'R', 'id':17},
          {'name':'S', 'id':18},
          {'name':'T', 'id':19},
          {'name':'U', 'id':20},
          {'name':'V', 'id':21},
          {'name':'W', 'id':22},
          {'name':'X', 'id':23},
          {'name':'Y', 'id':24},
          ]

with open(ANNOTATION_PATH + 'label_map.pbtxt', 'w') as f:
    for label in labels:
        f.write('item { 
')
        f.write('name:'{}'
'.format(label['name']))
        f.write('id:{}
'.format(label['id']))
        f.write('}
')
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-5-294439053577> in <module>()
     25           ]
     26 
---> 27 with open(ANNOTATION_PATH + 'label_map.pbtxt', 'w') as f:
     28     for label in labels:
     29         f.write('item { 
')

FileNotFoundError: [Errno 2] No such file or directory: 'Tensorflow/workspace/annotations\label_map.pbtxt'

I'll be really grateful if someone can help me!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...