tensorflow / models

Models and examples built with TensorFlow
Other
76.93k stars 45.8k forks source link

ResNet50V1 classification checkpoint not loaded when training Faster-RCNN from scratch on custom dataset #9079

Open ujjwal-ai opened 4 years ago

ujjwal-ai commented 4 years ago

I am trying to use this config file for training on a different dataset.

My tensorflow version is 2.3 (stable).

In order to use the classification checkpoint of ResNet50V1, I did the following:


import tensorflow as tf
model = tf.keras.applications.ResNet50(weights='imagenet')
checkpoint = tf.train.Checkpoint(model=model)
checkpoint.save(<CKPT_PATH>)

Then I provide the path to this checkpoint file in the config file. On running the training using model_main_tf2.py, I receive the same message as has been previously referenced in #8892 .

How can this issue be resolved ? Am I making a mistake here ?

ujjwal-ai commented 4 years ago

I would normally have posted this issue on StackOverFlow, but following are reasons for this being here:

  1. There is no clarity about which classification checkpoints to use.
  2. There is no proper example or documentation about it.
  3. Multiple issues (#8892 for example and there are others) which report the same problem and have not yet been resolved.
  4. This backward compatibility issue is a big mess because too much of legacy code is mixed in with the new code. It would have been better to have two branches ( one for TF1 and one for TF2). Me as a developer would have loved to contribute to achieve that.

I am against tagging this issue as support. Documentation is a quintessential part of any project. If the documentation does not mention anything and this has been released, it looks like a bug to me.

ujjwal-ai commented 4 years ago

What else have I tried ? a) Tried on TF 2.2 ( DOES NOT WORK ) b) Tried using pretrained models from tfhub ( DOES NOT WORK) c) Tried using checkpoints on google cloud ( DOES NOT WORK)

aabbas90 commented 4 years ago

What else have I tried ? a) Tried on TF 2.2 ( DOES NOT WORK ) b) Tried using pretrained models from tfhub ( DOES NOT WORK) c) Tried using checkpoints on google cloud ( DOES NOT WORK)

Perhaps some discussion from this issue is helpful: https://github.com/tensorflow/models/issues/8967