UnboundLocalError: local variable 'total_loss' referenced before assignment
I download the lastest codes 'tensorflow/models' to test the ssd_mobinetv2 model today. But when training I met the problem ,It never occurs before when I used the codes which were released about 2 months ago .
system summary ubuntu 16.04: 32 GB RAM GPU : GeForce Titan XP *2 cuda : 9.0 cudnn: 7.1 tensorflow-gpu: 1.5.0 python: 2.7
error log Here is the error log
python object_detection/train.py --logtostderr --train_dir='/home/eco/tr
ain_1.0_eco_ssdlite_v2' --pipeline_config_path='/home/eco/train_1.0_eco_ssdlite_v2/ssd_mobilenet_v2.config'
/usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
WARNING:tensorflow:From /home/eco/tensorflow/models/research/object_detection/trainer.py:228: create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.create_global_step
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:Summary name /clone_loss is illegal; using clone_loss instead.
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/contrib/slim/python/slim/learning.py:736: init (from tensorflow.python.training.supervisor) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.MonitoredTrainingSession
2018-03-24 12:21:01.119649: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-03-24 12:21:01.407238: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] Found device 0 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:05:00.0
totalMemory: 11.90GiB freeMemory: 11.21GiB
2018-03-24 12:21:01.594617: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] Found device 1 with properties:
name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:09:00.0
totalMemory: 11.90GiB freeMemory: 11.74GiB
2018-03-24 12:21:01.595355: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Device peer to peer matrix
2018-03-24 12:21:01.595392: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1126] DMA: 0 1
2018-03-24 12:21:01.595399: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1136] 0: Y Y
2018-03-24 12:21:01.595404: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1136] 1: Y Y
2018-03-24 12:21:01.595413: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: TITAN Xp, pci bus id: 0000:05:00.0, compute capability: 6.1)
2018-03-24 12:21:01.595420: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:1) -> (device: 1, name: TITAN Xp, pci bus id: 0000:09:00.0, compute capability: 6.1)
INFO:tensorflow:Starting Session.
INFO:tensorflow:Saving checkpoint to path /home/eco/train_1.0_eco_ssdlite_v2/model.ckpt
INFO:tensorflow:Starting Queues.
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Caught OutOfRangeError. Stopping Training.
INFO:tensorflow:Finished training! Saving model to disk.
Traceback (most recent call last):
File "object_detection/train.py", line 167, in
I think in your .config about path incorrect.
@Apirom e.....sorry,you are right the input_path is indeed incorrect in the .config ,and the prompt messages are different from before. thanks!
I have the same issue with python 3.5 on cpu
Hi,
I got the same issue with Python 3.6 with the tensorflow_gpu framework(Ver 1.5). It seems that be related to "checkpint" path in the pipeline.config file. Could you help teach me how to configure the setting? Thanks.
/======log message INFO:tensorflow:Restoring parameters from object_detection/model/train/model.ckpt-0 41 INFO:tensorflow:Starting Session. 42 INFO:tensorflow:Saving checkpoint to path object_detection/model/train/model.ckpt 43 INFO:tensorflow:Starting Queues. 44 INFO:tensorflow:global_step/sec: 0 45 INFO:tensorflow:Caught OutOfRangeError. Stopping Training. 46 INFO:tensorflow:Finished training! Saving model to disk. 47 Traceback (most recent call last): ======/
another solution to possible cause is you didn't created the test.record and train.record files for creating these,you need to run these two commands
python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
python generate_tfrecord.py --csv_input=images\test_labels.csv --image_dir=images\test --output_path=test.record