Training problem: didn't use GPU
Help! Here is my cmds:
python main.py --training_file_pattern=./tfrecord/data*.tfrecord --model_name=efficientdet-d0 --model_dir=./checkpoints/efficientdet-d0-scratch --hparams="use_bfloat16=false,num_classes=1,moving_average_decay=0" --num_classes=1 --use_tpu=False --train_batch_size=8 --ckpt=./weights/coco/efficientdet-d0 --num_examples_per_epoch=3000 --num_epochs=10 --eval_after_training=True --validation_file_pattern=./tfrecord/data*.tfrecord
But it didn't use GPU for training, and the CPU load is almost 99%. Platform: system: Win10 64bit Tensorflow-gpu=1.14.0 python=3.6 CUDA=10.0 cudnn=7.6.1
I0410 11:43:02.242400 20412 estimator.py:1145] Calling model_fn.
I0410 11:43:02.242400 20412 tpu_estimator.py:2965] Running train on CPU
Hi
You can run this command and see if TF even see's your GPU to start:
tf.config.list_physical_devices('GPU')
or older TF use this:
tf.test.is_gpu_available(
cuda_only=False, min_cuda_compute_capability=None
)
Assuming it doesn't see it, try to check the details on this page for hookup:
https://www.tensorflow.org/install/gpu
@lessw2020 Thanks for your help.
I run
tf.test.is_gpu_available( cuda_only=False, min_cuda_compute_capability=None )
and got:
2020-04-10 14:15:10.305806: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-04-10 14:15:10.307343: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library nvcuda.dll
2020-04-10 14:15:10.449649: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] Found device 0 with properties:
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.6575
pciBusID: 0000:01:00.0
2020-04-10 14:15:10.450091: I tensorflow/stream_executor/platform/default/dlopen_checker_stub.cc:25] GPU libraries are statically linked, skip dlopen check.
2020-04-10 14:15:10.451190: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1763] Adding visible gpu devices: 0
2020-04-10 14:15:11.262419: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1181] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-10 14:15:11.262716: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1187] 0
2020-04-10 14:15:11.262894: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1200] 0: N
2020-04-10 14:15:11.264070: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1326] Created TensorFlow device (/device:GPU:0 with 8788 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
It seems TF can find GPU devices and create tasks on it. So why CPU load is still high?
Check your CUDA environment.
Hello, I have encountered the same problem as you. Have you solved it
Help! Here is my cmds:
python main.py --training_file_pattern=./tfrecord/data*.tfrecord --model_name=efficientdet-d0 --model_dir=./checkpoints/efficientdet-d0-scratch --hparams="use_bfloat16=false,num_classes=1,moving_average_decay=0" --num_classes=1 --use_tpu=False --train_batch_size=8 --ckpt=./weights/coco/efficientdet-d0 --num_examples_per_epoch=3000 --num_epochs=10 --eval_after_training=True --validation_file_pattern=./tfrecord/data*.tfrecord
But it didn't use GPU for training, and the CPU load is almost 99%. Platform: system: Win10 64bit Tensorflow-gpu=1.14.0 python=3.6 CUDA=10.0 cudnn=7.6.1
I0410 11:43:02.242400 20412 estimator.py:1145] Calling model_fn.I0410 11:43:02.242400 20412 tpu_estimator.py:2965] Running train on CPU
@FancyFai - are you able to upgrade to TF 2.1+?
No guarantee that will fix it but have seen some issues resolve after people upgraded to TF2.1 or TF2.2 here. The codebase is sort of in between TF 1.15 and TF2.2 atm imo.
@FancyFai - are you able to upgrade to TF 2.1+? No guarantee that will fix it but have seen some issues resolve after people upgraded to TF2.1 or TF2.2 here. The codebase is sort of in between TF 1.15 and TF2.2 atm imo.
Thank you very much for your advice. After updating tensorflow to 2.0, I found that GPU can be used.It only took half an hour to train the d2 network 150 epoch, but I found that after upgrading tensorflow, the evaluation would report an error, and I used tensorflow 1.14 to get it, which felt strange
@FancyFai Your eval should be fine for tf2.x. Let me know if you still have issues.
I upgraded from TF 2.1 to TF 2.2 and that solved it for me.