models icon indicating copy to clipboard operation
models copied to clipboard

Unable to run Mask RCNN Resnet 101

Open chansekar opened this issue 8 years ago • 11 comments

Hi,

I was trying to train 'mask_rcnn_resnet101', with the below command

python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/mask_rcnn_resnet101_atrous_coco.config

However i get bug which states

Message type "object_detection.protos.FasterRcnn" has no field named "number_of_stages".

Not sure how to go about, can anyone let me know how to go about?

Regards Sekar

chansekar avatar Mar 08 '18 10:03 chansekar

I am also facing similar issues, somebody please help us out.

somsukla avatar Mar 09 '18 17:03 somsukla

Please check if your models/research/object_detection/protos/faster_rcnn.proto file is up-to-date. We added this number_of_stages field and refactor the code a bit some time earlier. I guess you're using a earlier version which is not compatible with the models built with newer version.

pkulzc avatar Mar 09 '18 22:03 pkulzc

Hi pkulzc

I downloaded the latest version and tried training, however i got the below error

AttributeError: module 'tensorflow.contrib.slim.python.slim.data.tfexample_decoder' has no attribute 'LookupTensor'

is it something to do 'tfexample_decoder.py'?

Regards Sekar

chansekar avatar Mar 14 '18 13:03 chansekar

Ah, LookupTensor is in tf 1.5 and later version. Please install tensorflow 1.5.0 if possible.

pkulzc avatar Mar 14 '18 15:03 pkulzc

Hi pkulzc,

I did install tf 1.5, its on cuda 8.

However i get the error 'Expected int32, got range(0, 3) of type 'range' instead'

There is a thread with similar error, but i dont see any credible solution on it too

Regards Sekar

chansekar avatar Mar 15 '18 11:03 chansekar

Hi @chansekar, @pkulzc

I am also experiencing the error with LookupTensor: AttributeError: module 'tensorflow.contrib.slim.python.slim.data.tfexample_decoder' has no attribute 'LookupTensor'

I am using TF 1.6 and the object detection API. If I run it locally it works, but if I run it on gcloud I get that error.

Could you fix this problem?

Thanks and best regards, mja21

mja21 avatar Mar 19 '18 13:03 mja21

@mja21 gcloud only supports 1.4 for now, so you probably want to wait for the fix (happening soon).

@chansekar please attach more details so we can take a look.

pkulzc avatar Mar 19 '18 14:03 pkulzc

Hi Pkulzc,

here is the complete error i got for cnn_resnet101_atrous_coco.config

INFO:tensorflow:Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. WARNING:tensorflow:From /home/naveen/Sekarz/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:Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. INFO:tensorflow:depth of additional conv before box predictor: 0 INFO:tensorflow:Scale of 0 disables regularizer. WARNING:tensorflow:From /home/naveen/Sekarz/models/research/object_detection/core/box_predictor.py:396: calling reduce_mean (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead WARNING:tensorflow:From /home/naveen/Sekarz/models/research/object_detection/core/losses.py:316: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.

See tf.nn.softmax_cross_entropy_with_logits_v2.

WARNING:tensorflow:From /home/naveen/Sekarz/models/research/object_detection/meta_architectures/faster_rcnn_meta_arch.py:1854: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead Traceback (most recent call last): File "train.py", line 168, in tf.app.run() File "/home/naveen/.virtualenvs/tfgpu15/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "train.py", line 164, in main worker_job_name, is_chief, FLAGS.train_dir) File "/home/naveen/Sekarz/models/research/object_detection/trainer.py", line 255, in train train_config.optimizer) File "/home/naveen/Sekarz/models/research/object_detection/builders/optimizer_builder.py", line 50, in build learning_rate = _create_learning_rate(config.learning_rate) File "/home/naveen/Sekarz/models/research/object_detection/builders/optimizer_builder.py", line 108, in _create_learning_rate learning_rate_sequence) File "/home/naveen/Sekarz/models/research/object_detection/utils/learning_schedules.py", line 154, in manual_stepping tf.constant(range(num_boundaries), dtype=tf.int32), File "/home/naveen/.virtualenvs/tfgpu15/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 212, in constant value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/home/naveen/.virtualenvs/tfgpu15/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 413, in make_tensor_proto _AssertCompatible(values, dtype) File "/home/naveen/.virtualenvs/tfgpu15/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 328, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got range(0, 3) of type 'range' instead.

chansekar avatar Mar 22 '18 12:03 chansekar

@pkulzc AttributeError: module 'tensorflow.contrib.slim.python.slim.data.tfexample_decoder' has no attribute 'LookupTensor'

is there some way to deal this solution with tensorflow 1.4?

HarshalGarg avatar May 08 '18 04:05 HarshalGarg

@HarshalGarg a hacky way would be copy the implementation of LookupTensor from tensorflow to this file and use your own copy. Or you can use this 1.2 compatible branch for now. We will release a new version that can be run on CMLE with 1.6 runtime soon.

pkulzc avatar May 08 '18 05:05 pkulzc

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 23:01 tensorflowbutler