rstudio / tfhub

R interface to TensorFlow Hub
28 stars 7 forks source link

Error in py_call_impl(callable, dots$args, dots$keywords) : ValueError: Non-callable result from hub.load('https://tfhub.dev/google/elmo/2') #7

Closed turgut090 closed 5 years ago

turgut090 commented 5 years ago

Hi Daniel, I thought that TensorFlow downgrading (1.14) could help to load Elmo model from tf.hub.

But I get the following error.

elmo <- layer_hub(
  handle = "https://tfhub.dev/google/elmo/2",
  trainable = F
)

 Error in py_call_impl(callable, dots$args, dots$keywords) : 
  ValueError: Non-callable result from hub.load('https://tfhub.dev/google/elmo/2') 

I cannot load anything which is not related to tf_2. What could be the reason for that?

dfalbel commented 5 years ago

@henry090 This seems like a bug in hub.load which is behind layer_hub (see https://github.com/tensorflow/hub/issues/349)

You can use the proposed fix in the issue above in R by using hub_load , subsetting the signatures and using the model just like a Keras layer.