Detectnet_v2 Resume Training from Checkpoint

Hi,
For the past week I have been trying to train a dataset with detectnet_v2 and resnet18 backbone, downloaded from NGC. Nearly, four times the training got shut in between the number of epochs. I specified in the config 200 epochs. In all cases, the machine restarted and I could not note down the error. I am running the latest docker container instance downloaded from NGC.

System specs: GPU - 2080 Ti RTX (11 GB RAM), Ubuntu 18.04, CUDA 10.1, Driver 430.50, TLT: Docker image streamanalytics v2.0, Detectnet_v2.
Dataset: 55000 images with annotations, Train:Val = 80:20.
I have two queries:
(a) Why did the tlt-train end abruptly and the machine restarted (I am using a batch-size of 32)? I have also tried with batch-size 16, it restarted after a few epochs.
(b) As stated in the release, I did not see the training resume from the checkpoint where it got abruptly ended. I did not make any changes to the spec files. Just ran the same command, and the training again restarted from epoch 0. Hence, resuming the training from previous checkpoint is not happening automatically. Is there any option, which we need to set explicitly in the spec files ?

The last failure, I was able to take down the error. It is pasted below.


[e1e92165c1ab:01551] Signal: Aborted (6)
[e1e92165c1ab:01551] Signal code: (-6)
[e1e92165c1ab:01551] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fb7ce4c4390]
[e1e92165c1ab:01551] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fb7ce11e428]
[e1e92165c1ab:01551] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fb7ce12002a]
[e1e92165c1ab:01551] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x777ea)[0x7fb7ce1607ea]
[e1e92165c1ab:01551] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fb7ce16937a]
[e1e92165c1ab:01551] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fb7ce16d53c]
[e1e92165c1ab:01551] [ 6] /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZNSt14_Function_base13_Base_managerIZN10tensorflow10WhereGPUOpIbE16ComputeAsyncTypeIiEEvRKNS1_6TensorEiPNS1_15OpKernelContextESt8functionIFvvEEEUlvE_E10_M_managerERSt9_Any_dataRKSF_St18_Manager_operation+0x7d)[0x7fb77ac6c50d]
[e1e92165c1ab:01551] [ 7] /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow8EventMgr11ThenExecuteEPN15stream_executor6StreamESt8functionIFvvEE+0x14c)[0x7fb77a72ef3c]
[e1e92165c1ab:01551] [ 8] /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow10WhereGPUOpIbE16ComputeAsyncTypeIiEEvRKNS_6TensorEiPNS_15OpKernelContextESt8functionIFvvEE+0x744)[0x7fb77ac83554]
[e1e92165c1ab:01551] [ 9] /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so(_ZN10tensorflow10WhereGPUOpIbE12ComputeAsyncEPNS_15OpKernelContextESt8functionIFvvEE+0x9a)[0x7fb77ac8659a]
[e1e92165c1ab:01551] [10] /usr/local/lib/python2.7/dist-packages/tensorflow/python/…/libtensorflow_framework.so(_ZN10tensorflow13BaseGPUDevice12ComputeAsyncEPNS_13AsyncOpKernelEPNS_15OpKernelContextESt8functionIFvvEE+0x184)[0x7fb776f6da04]
[e1e92165c1ab:01551] [11] /usr/local/lib/python2.7/dist-packages/tensorflow/python/…/libtensorflow_framework.so(+0x722d5d)[0x7fb776fb8d5d]
[e1e92165c1ab:01551] [12] /usr/local/lib/python2.7/dist-packages/tensorflow/python/…/libtensorflow_framework.so(+0x72374a)[0x7fb776fb974a]
[e1e92165c1ab:01551] [13] /usr/local/lib/python2.7/dist-packages/tensorflow/python/…/libtensorflow_framework.so(_ZN5Eigen15ThreadPoolTemplIN10tensorflow6thread16EigenEnvironmentEE10WorkerLoopEi+0x306)[0x7fb77702adc6]
[e1e92165c1ab:01551] [14] /usr/local/lib/python2.7/dist-packages/tensorflow/python/…/libtensorflow_framework.so(_ZNSt17_Function_handlerIFvvEZN10tensorflow6thread16EigenEnvironment12CreateThreadESt8functionIS0_EEUlvE_E9_M_invokeERKSt9_Any_data+0x44)[0x7fb777029c84]
[e1e92165c1ab:01551] [15] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80)[0x7fb7692abc80]
[e1e92165c1ab:01551] [16] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fb7ce4ba6ba]
[e1e92165c1ab:01551] [17] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fb7ce1f041d]
[e1e92165c1ab:01551] *** End of error message ***
/usr/local/bin/tlt-train: line 32: 1551 Aborted (core dumped) tlt-train-g1 ${PYTHON_ARGS[*]}


I followed the solution provided online (github of tensorflow) to set the following:

sudo apt-get install libtcmalloc-minimal4
sudo apt-get install google-perftools
export LD_PRELOAD=“/usr/lib/libtcmalloc_minimal.so.4”

Any response, would be quite helpful.

Possibly you are using an incompatible type of CPU that the TensorFlow package in TLT container does not support. What is the CPU info in your host PC?
Referece:

Thanks for the tip.

Update from my side:

  1. I was able to see job completion for 120 epochs using a batch-size of 8 yesterday.
  2. With a smaller dataset of 20000 images+labels, batch-size:32, the job got completed even for 500 epochs on the same machine.

Hence, it could be batch-size issue. Please confirm that it is the case.

My second query is with regard to resuming training. A case in point is resuming my training for the model generated in point 1 (at the end of epoch 120) to 300 epochs. How to do it ? Could you please help ?


cpu info (for one core):

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core™ i7-8700K CPU @ 3.70GHz
stepping : 10
microcode : 0xca
cpu MHz : 804.392
cache size : 12288 KB
physical id : 0
siblings : 12
core id : 0
cpu cores : 6
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips : 7392.00
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual


Hope this will help you clarify if the CPU is not compatible.

Hi,
Normally, the training inside the docker will not lead to host PC restarting. You mention that

  1. bs=8, epoch=120, successfully, no restarting
  2. bs=32, epoch=500, successfully, no restarting
  3. bs=32 , the tlt-train end abruptly and the machine restarted
  4. bs= 16, it restarted after a few epochs.

I am littile confusing from above four experiments. Why sometimes succesful with bs=32 but sometimes failed? Could you please give more details? Thanks.

If possible, please share training spec and full training log too. Thanks.
For resume training from checkpoint, I am checking and will update if any finding.

For temporary solution, please run below before resuming training from checkpoint.

export SUPPRES_VERBOSE_LOGGING=0

Sorry for inconvenient.
More, although you may find the training runs at “Epoch 0” during resuming training, please ignore. Actually it already trains from the checkpoint.

1 Like

Please find the drive links to logs of failed runs.

Point 2. bs=32, epochs=500. Successful run. With number of samples = 20000.
Point 3. bs=32, epochs=200. Not successful. Abruptly ended in once case after some 30 epochs and in other case after 90+ epoch. Sample size ~ 55000. Machine restarted.
Point 4. bs=16. Not successful. Machine restarted.

Hope it is now clear.

Ok. Will check. Thanks.

Hi us.raghavender.efkon,

Is this still an issue to support? Any result can be shared?

Thanks

Hi kayccc,

Thanks. The problem is solved with the solution provided by Morganh.

You can close this as solved.

Thanks