• 카테고리

    질문 & 답변
  • 세부 분야

    컴퓨터 비전

  • 해결 여부

    미해결

mask r cnn_inference시 오류 발생에 관해서

20.08.08 23:37 작성 조회수 324

0

항상 좋은 강의 감사 합니다.

mask r cnn 모델 학습 후 학습된 모델의 weight 파일을 MaskRCNN의 inference 모델로 로딩시 

아래와 같이 오류가 발생 합니다.

WARNING:tensorflow:From /home/*****google/anaconda3/envs/tf113/lib/python3.6/site-packages/mrcnn/model.py:768: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
model path: ('./snapshots_result/balloon20200808T1406', './snapshots_result/balloon20200808T1406/mask_rcnn_balloon_0050.h5')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-0567360a6bea> in <module>
      4 print('model path:', weights_path)
      5 # 지정된 weight 파일명으로 모델에 로딩.
----> 6 model.load_weights(weights_path, by_name=True)

~/anaconda3/envs/tf113/lib/python3.6/site-packages/mrcnn/model.py in load_weights(self, filepath, by_name, exclude)
   2084         if h5py is None:
   2085             raise ImportError('`load_weights` requires h5py.')
-> 2086         f = h5py.File(filepath, mode='r')
   2087         if 'layer_names' not in f.attrs and 'model_weights' in f:
   2088             f = f['model_weights']

~/anaconda3/envs/tf113/lib/python3.6/site-packages/h5py/_hl/files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds)
    393                 name = repr(name).encode('ASCII', 'replace')
    394             else:
--> 395                 name = filename_encode(name)
    396 
    397             if track_order is None:

~/anaconda3/envs/tf113/lib/python3.6/site-packages/h5py/_hl/compat.py in filename_encode(filename)
    109     filenames in h5py for more information.
    110     """
--> 111     filename = fspath(filename)
    112     if sys.platform == "win32":
    113         if isinstance(filename, six.text_type):

TypeError: expected str, bytes or os.PathLike object, not tuple

답변 2

·

답변을 작성해보세요.

0

감사합니다

0

안녕하십니까,

일단 오류는 학습된 weight 파일을 찾지 못하거나, weight 파일이 손상된 것으로 보입니다.

./snapshots_result/ 디렉토리 밑에 학습된 weight 파일이 제대로 있는지 다시 한번 확인 부탁드립니다. 

만약 제대로 있다면 학습을 다시 수행한 뒤에 결과 update 부탁드립니다.

감사합니다.