Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: must be str, not bytes #9

Open
sdberardinelli opened this issue Apr 4, 2017 · 0 comments
Open

TypeError: must be str, not bytes #9

sdberardinelli opened this issue Apr 4, 2017 · 0 comments

Comments

@sdberardinelli
Copy link

When running dump_filters:

python dump_filters.py 
>> Downloading inception-2015-12-05.tgz 100.0%
Succesfully downloaded inception-2015-12-05.tgz 88931400 bytes.
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x5f52e40
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2ee8240
W tensorflow/stream_executor/cuda/cuda_driver.cc:590] creating context when one is currently active; existing: 0x2eea560
W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
169 0.891073
75 0.00779056
7 0.00295913
325 0.00146577
878 0.00117424
Traceback (most recent call last):
  File "dump_filters.py", line 292, in <module>
    tf.app.run()
  File "/usr/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 44, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "dump_filters.py", line 289, in main
    run_inference_on_image(image)
  File "dump_filters.py", line 137, in run_inference_on_image
    dump_convbn(sess, 'conv')
  File "dump_filters.py", line 69, in dump_convbn
    padding = make_padding(conv.get_attr("padding"), weights.shape)
  File "dump_filters.py", line 62, in make_padding
    sys.exit('Invalid padding name '+padding_name)
TypeError: must be str, not bytes

I'm not sure why this happens, but I was able to work around this by adding

padding_name = (padding_name.decode("utf-8"))

in make_padding before the conditions. After adding this it seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant