somaticio / tensorflow.rb

tensorflow for ruby
BSD 3-Clause "New" or "Revised" License
827 stars 66 forks source link

example.rb giving undefined method `length' error #72

Closed obromios closed 7 years ago

obromios commented 7 years ago

I have asked the following question on stackoverflow but have had no answer:

I have installed tensorflow.rb using docker, as described. When I run bundle exec rspec spec, all examples pass.

I have created a file example.rb as instructed. When I run the file using ruby example.rb, I get the following error

/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:168:in `graph_def_to_c_array': undefined method `length' for nil:NilClass (NoMethodError)
    from /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:51:in `extend_graph'
    from example.rb:9:in `<main>'

When I run each line of example.rb in an irb session, the error occurs at the command:

session.extend_graph(graph)

How do I fix this?

chrhansen commented 7 years ago

I've followed up with a question over there.

obromios commented 7 years ago

I have replied to your query on stack overflow.

chrhansen commented 7 years ago

@nethsix Do you know why the docker image is not pulling in the latest commit? http://stackoverflow.com/questions/39995058/ruby-gem-tensorflow-rb-example-not-working?noredirect=1#comment67337965_39995058

arafatkatze commented 7 years ago

I think the issue here is that docker is not really using the latest repository. The current repository has around 80+ tests whereas the docker version would have around(40-50 tests I am not sure of the exact number). (@nethsix might know why this is happening ) @obromios Would it be possible for you to make use of the long install instructions given in the Wiki (They are most likely going to work fine for you)? We will try to fix this issue as soon as possible or I will upload a new docker image.

obromios commented 7 years ago

Hi

I just have a casual interest in this, and I also wanted to try docker. I am prepared to believe long install instructions would work for me, but am happy to wait until you have a chance to update the docker package.

Chris

On Fri, Oct 14, 2016 at 2:24 PM, Arafat notifications@github.com wrote:

I think the issue here is that docker is not really using the latest repository. The current repository has around 80+ tests whereas the docker version would have around(40-50 tests I am not sure of the exact number). ( @nethsix https://github.com/nethsix might know why this is happening ) @obromios https://github.com/obromios Would it be possible for you to make use of the long install instructions https://github.com/somaticio/tensorflow.rb#installation-1 given in the Wiki (They are most likely going to work fine for you)? We will try to fix this issue as soon as possible or I will upload a new docker image.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/somaticio/tensorflow.rb/issues/72#issuecomment-253700389, or mute the thread https://github.com/notifications/unsubscribe-auth/ABU2makYwvTLQKdJbF-Q1PevlEfIduE7ks5qzvX3gaJpZM4KVo1S .

nethsix commented 7 years ago

Hey all,

Thanks for reporting it. Let me take a look at it tomorrow morning.

On Friday, October 14, 2016, Chris notifications@github.com wrote:

Hi

I just have a casual interest in this, and I also wanted to try docker. I am prepared to believe long install instructions would work for me, but am happy to wait until you have a chance to update the docker package.

Chris

On Fri, Oct 14, 2016 at 2:24 PM, Arafat <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I think the issue here is that docker is not really using the latest repository. The current repository has around 80+ tests whereas the docker version would have around(40-50 tests I am not sure of the exact number). ( @nethsix https://github.com/nethsix might know why this is happening ) @obromios https://github.com/obromios Would it be possible for you to make use of the long install instructions https://github.com/somaticio/tensorflow.rb#installation-1 given in the Wiki (They are most likely going to work fine for you)? We will try to fix this issue as soon as possible or I will upload a new docker image.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/somaticio/tensorflow.rb/issues/72# issuecomment-253700389, or mute the thread https://github.com/notifications/unsubscribe-auth/ABU2makYwvTLQKdJbF- Q1PevlEfIduE7ks5qzvX3gaJpZM4KVo1S .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/somaticio/tensorflow.rb/issues/72#issuecomment-253726343, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUdk1BFMLhE2U9q-9aVfVugsn4BAD9Gks5qzytsgaJpZM4KVo1S .

arafatkatze commented 7 years ago

Thanks @nethsix

nethsix commented 7 years ago

I've updated the docker image. Updated the tools/docker/Dockerfile as well. Pull requested some updates to using Docker on the README.

On Friday, October 14, 2016, Arafat notifications@github.com wrote:

Thanks @nethsix https://github.com/nethsix

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/somaticio/tensorflow.rb/issues/72#issuecomment-253807452, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUdk3CxE-HJJ-3O40AXCZ7pIVhA9LYkks5qz4rlgaJpZM4KVo1S .

obromios commented 7 years ago

I have tested the new instructions and new docker image, and it all works perfectly. Thank you for your help.