I am trying to run a project. For that, I used the pre-trained RestNet50 model but I am getting the error.
First, I took the RestNet50 model and then store the checkpoint and after that, I am trying to load the stored checkpoint but I am getting the error.
After loading the checkpoint error is coming that, weights not found.
Initial run:
Loading initial_checkpoint: /content/resnet/resnet_v1_50.ckpt
WARNING:tensorflow:From /content/pose-sensitive-embedding/helper/checkpoint_helper.py:27: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.
Traceback (most recent call last):
File "/content/pose-sensitive-embedding/trainer_views.py", line 100, in
main()
File "/content/pose-sensitive-embedding/trainer_views.py", line 94, in main
args.num_classes)
File "/content/pose-sensitive-embedding/trainer_views.py", line 37, in start_training
run_training(dataset_factory, batch_size, batch_threads, epoch, estimator, num_epochs, image_size)
File "/content/pose-sensitive-embedding/trainer_views.py", line 53, in run_training
estimator.train(input_fn=train_input_function)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1191, in _train_model_default
features, labels, ModeKeys.TRAIN, self.config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1149, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/content/pose-sensitive-embedding/helper/model_helper.py", line 49, in model_fn
check_init_from_initial_checkpoint(output_directory, initial_checkpoint, checkpoint_exclude_scopes, ignore_missing_variables)
File "/content/pose-sensitive-embedding/helper/checkpoint_helper.py", line 14, in check_init_from_initial_checkpoint
init_from_checkpoint(initial_checkpoint, checkpoint_exclude_scopes, ignore_missing_variables)
File "/content/pose-sensitive-embedding/helper/checkpoint_helper.py", line 20, in init_from_checkpoint
tf.contrib.framework.init_from_checkpoint(initial_checkpoint, variables_dictionary)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/contrib/framework/python/framework/checkpoint_utils.py", line 244, in init_from_checkpoint
tensor_name_in_ckpt, checkpoint_dir, variable_map
ValueError: Tensor resnet_v1_50/conv1/weights is not found in /content/resnet/resnet_v1_50.ckpt checkpoint {'w2_3': [5], 'w2_2': [5], 'w1': [2], 'w2_1': [5], 'w1_2': [2], 'w1_3': [2], 'w1_1': [2], 'w2': [5]}
I am trying to run a project. For that, I used the pre-trained RestNet50 model but I am getting the error. First, I took the RestNet50 model and then store the checkpoint and after that, I am trying to load the stored checkpoint but I am getting the error. After loading the checkpoint error is coming that, weights not found.
Initial run: Loading initial_checkpoint: /content/resnet/resnet_v1_50.ckpt WARNING:tensorflow:From /content/pose-sensitive-embedding/helper/checkpoint_helper.py:27: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.
Traceback (most recent call last): File "/content/pose-sensitive-embedding/trainer_views.py", line 100, in
main()
File "/content/pose-sensitive-embedding/trainer_views.py", line 94, in main
args.num_classes)
File "/content/pose-sensitive-embedding/trainer_views.py", line 37, in start_training
run_training(dataset_factory, batch_size, batch_threads, epoch, estimator, num_epochs, image_size)
File "/content/pose-sensitive-embedding/trainer_views.py", line 53, in run_training
estimator.train(input_fn=train_input_function)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1191, in _train_model_default
features, labels, ModeKeys.TRAIN, self.config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1149, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/content/pose-sensitive-embedding/helper/model_helper.py", line 49, in model_fn
check_init_from_initial_checkpoint(output_directory, initial_checkpoint, checkpoint_exclude_scopes, ignore_missing_variables)
File "/content/pose-sensitive-embedding/helper/checkpoint_helper.py", line 14, in check_init_from_initial_checkpoint
init_from_checkpoint(initial_checkpoint, checkpoint_exclude_scopes, ignore_missing_variables)
File "/content/pose-sensitive-embedding/helper/checkpoint_helper.py", line 20, in init_from_checkpoint
tf.contrib.framework.init_from_checkpoint(initial_checkpoint, variables_dictionary)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/contrib/framework/python/framework/checkpoint_utils.py", line 244, in init_from_checkpoint
tensor_name_in_ckpt, checkpoint_dir, variable_map
ValueError: Tensor resnet_v1_50/conv1/weights is not found in /content/resnet/resnet_v1_50.ckpt checkpoint {'w2_3': [5], 'w2_2': [5], 'w1': [2], 'w2_1': [5], 'w1_2': [2], 'w1_3': [2], 'w1_1': [2], 'w2': [5]}