前提・実現したいこと
こちらの方の記事に従い、yolov3で独自データの学習を試みました。そしてpython train.pyで学習を実行したところ、
FileNotFoundError: [Errno 2] No such file or directory: 'xxx033'
とエラーが発生してしまいました。なお、このxxx033はtrain.pyを実行するごとに数値が変わります。
これを解決するにはどう対処すればよいでしょうか?ご協力よろしくお願いします。
発生している問題・エラーメッセージ
WARNING:は省略 Create YOLOv3 model with 9 anchors and 4 classes. C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_59 due to mismatch in shape ((1, 1, 1024, 27) vs (255, 1024, 1, 1)). weight_values[i].shape)) 略 Train on 54 samples, val on 6 samples, with batch size 32. Epoch 1/50 Traceback (most recent call last): File "train.py", line 190, in <module> _main() File "train.py", line 65, in _main callbacks=[logging, checkpoint]) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\training_generator.py", line 181, in fit_generator generator_output = next(output_generator) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 709, in get six.reraise(*sys.exc_info()) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\six.py", line 703, in reraise raise value File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 685, in get inputs = self.queue.get(block=True).get() File "C:\Users\Anaconda3\envs\tf114\lib\multiprocessing\pool.py", line 657, in get raise self._value File "C:\Users\Anaconda3\envs\tf114\lib\multiprocessing\pool.py", line 121, in worker result = (True, func(*args, **kwds)) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 626, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "train.py", line 175, in data_generator image, box = get_random_data(annotation_lines[i], input_shape, random=True) File "C:\Users\keras-yolo3\yolo3\utils.py", line 39, in get_random_data image = Image.open(line[0]) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\PIL\Image.py", line 2878, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'xxx008' (tf114) C:\Users\keras-yolo3>python train.py Using TensorFlow backend. 2020-08-22 19:25:27.648550: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-08-22 19:25:27.655465: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll 2020-08-22 19:25:27.667801: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error 2020-08-22 19:25:27.673883: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: MyComputer 2020-08-22 19:25:27.677321: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: MyComputer Create YOLOv3 model with 9 anchors and 4 classes. C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_59 due to mismatch in shape ((1, 1, 1024, 27) vs (255, 1024, 1, 1)). weight_values[i].shape)) C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_59 due to mismatch in shape ((27,) vs (255,)). weight_values[i].shape)) C:\Users\hosaka\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_67 due to mismatch in shape ((1, 1, 512, 27) vs (255, 512, 1, 1)). weight_values[i].shape)) C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_67 due to mismatch in shape ((27,) vs (255,)). weight_values[i].shape)) C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_75 due to mismatch in shape ((1, 1, 256, 27) vs (255, 256, 1, 1)). weight_values[i].shape)) C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_75 due to mismatch in shape ((27,) vs (255,)). weight_values[i].shape)) Load weights model_data/yolo_weights.h5. Freeze the first 249 layers of total 252 layers. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where Train on 54 samples, val on 6 samples, with batch size 32. Epoch 1/50 Traceback (most recent call last): File "train.py", line 190, in <module> _main() File "train.py", line 65, in _main callbacks=[logging, checkpoint]) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\engine\training_generator.py", line 181, in fit_generator generator_output = next(output_generator) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 709, in get six.reraise(*sys.exc_info()) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\six.py", line 703, in reraise raise value File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 685, in get inputs = self.queue.get(block=True).get() File "C:\Users\Anaconda3\envs\tf114\lib\multiprocessing\pool.py", line 657, in get raise self._value File "C:\Users\Anaconda3\envs\tf114\lib\multiprocessing\pool.py", line 121, in worker result = (True, func(*args, **kwds)) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\keras\utils\data_utils.py", line 626, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "train.py", line 175, in data_generator image, box = get_random_data(annotation_lines[i], input_shape, random=True) File "C:\Users\keras-yolo3\yolo3\utils.py", line 39, in get_random_data image = Image.open(line[0]) File "C:\Users\Anaconda3\envs\tf114\lib\site-packages\PIL\Image.py", line 2878, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'xxx033'
該当のソースコード
python
1字数の関係上こちらを省略させていただきます。 2 3[リンク内容](https://github.com/qqwweee/keras-yolo3) 4 5こちらのtrain.pyを実行し、エラーが発生しました。 6 7 8### 試したこと 9記事中では 10 11アノテーション 12keras-yolo3/VOCDevkit/VOC2007/Annotations 13 --- xxx001.xml 14 15教師画像 16keras-yolo3/VOCDevkit/VOC2007/JPEGImages 17 --- xxx001.jpg 18 19と記述されており、ここでのアノテーション/教師データはひとつでいいのかな?と迷ったため、一つの場合(xxx001)とすべての場合(xxx001~xxx060)を両方試しました 20 21 22 23train.txtなどの位置をいろいろ変更して実行 24### 補足情報(FW/ツールのバージョンなど) 25 26anacoda 27python=3.7.7 28Tensoeflow 1.14.0 29cuda10.0 30cuDNN v7.6.5 31 32インストールした主なツールのバージョンは、すべて参考記事と同じです。 33極力参考記事に従いました。 34yoloはこちらのものをダウンロードしました。 35[リンク内容](https://github.com/qqwweee/keras-yolo3) 36 37 38記事に対して私が実行したときの差異 39クラス数は4 40画像データは60個で(xxx001.jpg~xxx060.jpg)、各クラス15枚 41train.txt(コピー)がtrain.pyと同じフォルダにある
回答1件
あなたの回答
tips
プレビュー