tensorflow / hub

A library for transfer learning by reusing parts of TensorFlow models.
https://tensorflow.org/hub
Apache License 2.0
3.49k stars 1.67k forks source link

Getting TypeError when running in Jupyter Notebook #123

Closed BazingaSu closed 6 years ago

BazingaSu commented 6 years ago

Had this error message when running example code

using Anaconda Jupyter notebook python 3.6 tensorflow ==1.8.0 tensor-hub ==0.1.1

`import tensorflow as tf

import tensorflow_hub as hub

module_url = "https://tfhub.dev/google/universal-sentence-encoder/2"

embed = hub.Module(module_url)`

screen shot 2018-07-31 at 6 52 11 pm

this snippet works in console but not in notebook , any idea ?

arnoegw commented 6 years ago

Can't repro. Are you sure you're really running tensorflow>=1.8.0? The _FlagValues class existed in TensorFlow versions up to and including 1.4, but was removed in https://github.com/tensorflow/tensorflow/commit/2652704b576adc16b4d735f651cea1024e88b72e#diff-92ab93112cecf0bbfb502800268d86f7

FWIW, tensorflow_hub=0.1.1 no longer contains a run-time check for the version for tensorflow, like tensorflow 0.1.0 did, because the regex in the original check choked on tensorflow 1.10.0. But tensorflow>=1.8.0 is still required.

BazingaSu commented 6 years ago

@arnoegw Thanks for the reply. it's my bad. my tensorflow was 1.4.0 when I ran this snippet for the first time and got this error. Then I updated tensorflow and reloaded the package but it wasn't actually effective, it was still 1.4.0.

It works now on tensorflow 1.8.0.

Thanks. closing issue.