tensorflow-resnet icon indicating copy to clipboard operation
tensorflow-resnet copied to clipboard

'convert.py' does not work with current 'resnet.py'

Open MarvinTeichmann opened this issue 7 years ago • 4 comments

Running convert.py outputs the error:

Traceback (most recent call last):
  File "convert.py", line 343, in <module>
    tf.app.run()
  File "/home/mifs/mttt2/.virtualenvs/tfr1.0/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "convert.py", line 339, in main
    convert(g, img, img_p, layers)
  File "convert.py", line 259, in convert
    bottleneck=True)
TypeError: inference() got an unexpected keyword argument 'preprocess'

The current version of resnet does not seem to have a preprocess option. Is this still required?

MarvinTeichmann avatar Mar 06 '17 13:03 MarvinTeichmann

I have met the same problem, and my tensorflow version is r0.12.

liyd avatar Mar 07 '17 10:03 liyd

Hi I am having the same issue. Did you find the way to solve it?

xiao1228 avatar Mar 21 '17 11:03 xiao1228

I just comment out the preporcess part.

xiao1228 avatar Mar 22 '17 15:03 xiao1228

add preporcess part in inference(...) function

def inference(x, is_training,
              num_classes=1000,
              num_blocks=None,  # defaults to 50-layer network
              use_bias=False,  # defaults to using batch norm
              preprocess=True,
              bottleneck=True):
    if num_blocks is None:
        num_blocks = [3, 4, 6, 3]
    if preprocess:
        x = _imagenet_preprocess(x)
    # ....

dnvtmf avatar Mar 29 '17 03:03 dnvtmf