balancap / SDC-Vehicle-Detection

Udacity Project - Vehicle Detection
226 stars 113 forks source link

Version of Python and Tensorflow? Issue with tf.select #3

Closed villanuevab closed 7 years ago

villanuevab commented 7 years ago

Hello! I am attempting to train the network using the KITTI dataset. I'm experiencing AttributeError: module 'tensorflow' has no attribute 'select'. See the full stacktrace below. I think this might be related to my dev environment. I am using a conda virtual environment with Anaconda python 3.6.1 and Tensorflow 1.0.1 with GPU support. What versions of python and TensorFlow do you use in your implementation? Thank you.

  File "train_ssd_network.py", line 540, in <module>
    tf.app.run()
  File "/home/blanca/miniconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "train_ssd_network.py", line 402, in main
    ssd_net.bboxes_encode(glabels, gbboxes, ssd_anchors)
  File "/home/blanca/ml-experiments/SDC-Vehicle-Detection/nets/ssd_vgg_300.py", line 174, in bboxes_encode
    scope=scope)
  File "/home/blanca/ml-experiments/SDC-Vehicle-Detection/nets/ssd_common.py", line 191, in tf_ssd_bboxes_encode
    prior_scaling, dtype)
  File "/home/blanca/ml-experiments/SDC-Vehicle-Detection/nets/ssd_common.py", line 142, in tf_ssd_bboxes_encode_layer
    feat_ymax, feat_xmax])
  File "/home/blanca/miniconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2605, in while_loop
    result = context.BuildLoop(cond, body, loop_vars, shape_invariants)
  File "/home/blanca/miniconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2438, in BuildLoop
    pred, body, original_loop_vars, loop_vars, shape_invariants)
  File "/home/blanca/miniconda2/envs/python3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2388, in _BuildLoop
    body_result = body(*packed_vars_for_body)
  File "/home/blanca/ml-experiments/SDC-Vehicle-Detection/nets/ssd_common.py", line 119, in body
    feat_scores = tf.select(mask, jaccard, feat_scores)
AttributeError: module 'tensorflow' has no attribute 'select'
villanuevab commented 7 years ago

tf.select() is deprecated and has been replaced with tf.where() as of TF 1.0.1 (GPU-ready).

The author @balancap has updated SSD-Tensorflow to fix the cause of this error but has not yet pushed changes to this repo. This (and other) error(s) were related to using deprecated TF functions and slight syntactic changes. Updating my SDC-Vehicle-Detection repo by replacing folders nets/ and preprocessing/ with the corresponding versions from SSD-Tensorflow, and adding the directory tf_extended/ to my repo as well. Depending on your use case, you may need to copy a few more files over.