models icon indicating copy to clipboard operation
models copied to clipboard

Estimator's model_fn (<function create_model_fn.<locals>.model_fn at 0x000001FC1818AD08>) includes params argument, but params are not passed to Estimator.

Open Luoice opened this issue 8 years ago • 6 comments

Please go to Stack Overflow for help and support:

http://stackoverflow.com/questions/tagged/tensorflow

Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • What is the top-level directory of the model you are using:
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • TensorFlow installed from (source or binary):
  • TensorFlow version (use command below):
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

Luoice avatar Nov 21 '18 01:11 Luoice

Closing this issue due to lack of information. Feel free to reopen the issue describing your problem in detail. Thanks!

ymodak avatar Nov 21 '18 21:11 ymodak

I'm actually having the same problem. First of all I'm running the object-detection training, like so:

python3 object_detection/model_main.py \
		--pipeline_config_path=config/faster_rcnn_resnet101.config \
		--model_dir=models \
		--alsologtostderr

I've downloaded faster_rcnn_resnet101_coco_2018_01_28.tar.gz from the model-zoo My config looks like this (paths are removed):

model {
  faster_rcnn {
    num_classes: 16
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 600
        max_dimension: 1800
      }
    }
    feature_extractor {
      type: 'faster_rcnn_resnet101'
      first_stage_features_stride: 16
    }
    first_stage_anchor_generator {
      grid_anchor_generator {
        scales: [0.25, 0.5, 1.0, 2.0]
        aspect_ratios: [0.5, 1.0, 2.0]
        height_stride: 16
        width_stride: 16
      }
    }
    first_stage_box_predictor_conv_hyperparams {
      op: CONV
      regularizer {
        l2_regularizer {
          weight: 0.0
        }
      }
      initializer {
        truncated_normal_initializer {
          stddev: 0.01
        }
      }
    }
    first_stage_nms_score_threshold: 0.0
    first_stage_nms_iou_threshold: 0.7
    first_stage_max_proposals: 300
    first_stage_localization_loss_weight: 2.0
    first_stage_objectness_loss_weight: 1.0
    initial_crop_size: 14
    maxpool_kernel_size: 2
    maxpool_stride: 2
    second_stage_box_predictor {
      mask_rcnn_box_predictor {
        use_dropout: false
        dropout_keep_probability: 1.0
        fc_hyperparams {
          op: FC
          regularizer {
            l2_regularizer {
              weight: 0.0
            }
          }
          initializer {
            variance_scaling_initializer {
              factor: 1.0
              uniform: true
              mode: FAN_AVG
            }
          }
        }
      }
    }
    second_stage_post_processing {
      batch_non_max_suppression {
        score_threshold: 0.0
        iou_threshold: 0.6
        max_detections_per_class: 100
        max_total_detections: 300
      }
      score_converter: SOFTMAX
    }
    second_stage_localization_loss_weight: 2.0
    second_stage_classification_loss_weight: 1.0
  }
}

train_config: {
  batch_size: 1
  optimizer {
    momentum_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.003
          schedule {
            step: 9000
            learning_rate: .0003
          }
          schedule {
            step: 1200000
            learning_rate: .0003
          }
        }
      }
      momentum_optimizer_value: 0.9
    }
    use_moving_average: false
  }
  gradient_clipping_by_norm: 10.0
  fine_tune_checkpoint: "faster_rcnn_resnet101_coco_2018_01_28/model.ckpt"
  from_detection_checkpoint: true
  load_all_detection_checkpoint_vars: true
  num_steps: 1000
  data_augmentation_options {
    random_image_scale {
    }
  }
}

train_input_reader: {
  tf_record_input_reader {
    input_path: "train.record"
  }
  label_map_path: "label_map.pbtxt"
}

eval_config: {
  metrics_set: "coco_detection_metrics"
  num_examples: 20
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "test.record"
  }
  label_map_path: "label_map.pbtxt"
  shuffle: false
  num_readers: 1
}

I'm using tensorflow-gpu 1.12.0

The full error-messages are:

WARNING:tensorflow:Forced number of epochs for all eval validations to be 1.
W1207 15:17:52.943896 140176330323776 tf_logging.py:125] Forced number of epochs for all eval validations to be 1.
WARNING:tensorflow:Expected number of evaluation epochs is 1, but instead encountered `eval_on_train_input_config.num_epochs` = 0. Overwriting `num_epochs` to 1.
W1207 15:17:52.944142 140176330323776 tf_logging.py:125] Expected number of evaluation epochs is 1, but instead encountered `eval_on_train_input_config.num_epochs` = 0. Overwriting `num_epochs` to 1.
WARNING:tensorflow:Estimator's model_fn (<function create_model_fn.<locals>.model_fn at 0x7f7cd6293268>) includes params argument, but params are not passed to Estimator.
W1207 15:17:52.944521 140176330323776 tf_logging.py:125] Estimator's model_fn (<function create_model_fn.<locals>.model_fn at 0x7f7cd6293268>) includes params argument, but params are not passed to Estimator.

This might be related to issue: 277 https://github.com/kubeflow/examples/issues/277

stvogel avatar Dec 07 '18 14:12 stvogel

I meet the same question like you.Could you has already solve it?@stvogel

Cecilia520 avatar Apr 23 '19 06:04 Cecilia520

Sorry, I can't remember ... it might have something to do with some of the parameters that changed int the .config-file (I used an old one and there have been changes ... so I took an example of the most recent version)

stvogel avatar Apr 23 '19 12:04 stvogel

Have you solved this problem?I have the same problem. @Cecilia520 .

xiangxiangjiang avatar Jul 11 '19 05:07 xiangxiangjiang

For me it was because I was saving the model for example here local_models/model_pets/, Then changed some config and and now if we go to save on the same directory. I deleted that model_dir local_models/model_pets/ and retrain then it worked for me.

harsh306 avatar Aug 04 '19 19:08 harsh306