yolov4-keras icon indicating copy to clipboard operation
yolov4-keras copied to clipboard

关于train报错的问题

Open codeman008 opened this issue 4 years ago • 3 comments

yolov4-keras>python train.py Using TensorFlow backend. WARNING: Logging before flag parsing goes to stderr. W0619 14:05:04.133064 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:95: The name tf.reset_default_graph is d eprecated. Please use tf.compat.v1.reset_default_graph instead.

W0619 14:05:04.134061 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:98: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0619 14:05:04.144034 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:102: The name tf.get_default_graph is de precated. Please use tf.compat.v1.get_default_graph instead.

W0619 14:05:04.145031 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:517: The name tf.placeholder is deprecat ed. Please use tf.compat.v1.placeholder instead.

Create YOLOv4 model with 9 anchors and 5 classes. W0619 14:05:04.146029 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:4138: The name tf.random_uniform is depr ecated. Please use tf.random.uniform instead.

2020-06-19 14:05:04.159481: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-06-19 14:05:04.164326: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll 2020-06-19 14:05:04.265335: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties: name: GeForce RTX 2080 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.635 pciBusID: 0000:01:00.0 2020-06-19 14:05:04.272995: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check. 2020-06-19 14:05:04.276394: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0 2020-06-19 14:05:04.834369: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-06-19 14:05:04.837165: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0 2020-06-19 14:05:04.839025: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N 2020-06-19 14:05:04.841512: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8694 MB memory) -> physica l GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5) W0619 14:05:05.187247 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:1834: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.

W0619 14:05:08.949218 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:3976: The name tf.nn.max_pool is depreca ted. Please use tf.nn.max_pool2d instead.

W0619 14:05:09.150654 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py:2018: The name tf.image.resize_nearest_n eighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead.

Load weights model_data/yolo4_weight.h5. C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_110 due to mismatch in shape ((1, 1, 1024, 30) vs (255, 1024, 1, 1)). weight_values[i].shape)) C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_110 due to mismatch in shape ((30,) vs (255,)). weight_values[i].shape)) C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_102 due to mismatch in shape ((1, 1, 512, 30) vs ( 255, 512, 1, 1)). weight_values[i].shape)) C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_102 due to mismatch in shape ((30,) vs (255,)). weight_values[i].shape)) C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_94 due to mismatch in shape ((1, 1, 256, 30) vs (2 55, 256, 1, 1)). weight_values[i].shape)) C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\saving.py:1140: UserWarning: Skipping loading of weights for layer conv2d_94 due to mismatch in shape ((30,) vs (255,)). weight_values[i].shape)) W0619 14:05:14.228083 51072 deprecation.py:323] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\tensorflow\python\ops\array_ops.py:1354: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where Freeze the first 249 layers of total 370 layers. W0619 14:05:15.692210 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\optimizers.py:790: The name tf.train.Optimizer is deprecated. Please u se tf.compat.v1.train.Optimizer instead.

Train on 6543 samples, val on 727 samples, with batch size 4. W0619 14:05:22.052212 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\callbacks.py:850: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.

W0619 14:05:22.052212 51072 deprecation_wrapper.py:119] From C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\callbacks.py:853: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.

Epoch 1/25 2020-06-19 14:05:27.713789: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] shape_optimizer failed: Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1) 2020-06-19 14:05:28.038298: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] remapper failed: Invalid argument: Subshape must have computed start >= end since stride is negativ e, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1) 2020-06-19 14:05:29.572795: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] layout failed: Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1) 2020-06-19 14:05:30.708524: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] shape_optimizer failed: Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1) 2020-06-19 14:05:30.933520: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] remapper failed: Invalid argument: Subshape must have computed start >= end since stride is negativ e, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1) 2020-06-19 14:05:33.817409: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED 2020-06-19 14:05:33.820917: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED Traceback (most recent call last): File "train.py", line 254, in callbacks=[logging, checkpoint, reduce_lr, early_stopping]) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator initial_epoch=initial_epoch) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\training_generator.py", line 217, in fit_generator class_weight=class_weight) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\engine\training.py", line 1217, in train_on_batch outputs = self.train_function(ins) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py", line 2715, in call return self._call(inputs) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\keras\backend\tensorflow_backend.py", line 2675, in _call fetched = self._callable_fn(*array_vals) File "C:\Users\assss\Anaconda3\envs\ID\lib\site-packages\tensorflow\python\client\session.py", line 1458, in call run_metadata_ptr) tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found. (0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[{{node conv2d_1/convolution}}]] [[loss/add_109/_4921]] (1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[{{node conv2d_1/convolution}}]] 0 successful operations. 0 derived errors ignored. 我的GPU cuda版本是10.1 请问下您是否遇到过此类问题,谢谢

codeman008 avatar Jun 19 '20 06:06 codeman008

有配置环境的视频呢

bubbliiiing avatar Jun 22 '20 13:06 bubbliiiing

我也遇到了这个问题, 你解决了嘛? @codeman008

yfor1008 avatar Jul 15 '20 08:07 yfor1008

重新配置环境,按照视频来

bubbliiiing avatar Jul 15 '20 08:07 bubbliiiing