IndentationError: unexpected indent
조회수 957회
# 마지막으로 정수 node ID로부터 인간이 읽을 수 있는 문자로의 맵핑을 로드함.
node_id_to_name = {}
for key, val in node_id_to_uid.items():
if val not in uid_to_human:
tf.logging.fatal('Failed to locate: %s', val)
name = uid_to_human[val]
node_id_to_name[key] = name
return node_id_to_name
def id_to_string(self, node_id):
if node_id not in self.node_lookup:
return ''
return self.node_lookup[node_id]
def create_graph():
"""저장된 GraphDef 파일로부터 그래프를 생성하고 저장된 값을 리턴함."""
# Creates graph from saved graph_def.pb.
with tf.gfile.FastGFile(os.path.join(
FLAGS.model_dir, 'classify_image_graph_def.pb'), 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
_ = tf.import_graph_def(graph_def, name='')
File "", line 11 def id_to_string(self, node_id): ^ IndentationError: unexpected indent 라고 오류가 뜨는데 띄어쓰기가 어디에서 잘못됬는지 모르겠습니다. 아! 참고로 Inception-v3 모델(이미지 인식모델)예제의 일부분 코드입니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력