Giter Site home page Giter Site logo

somaticio / tensorflow.rb Goto Github PK

View Code? Open in Web Editor NEW
827.0 827.0 66.0 2.7 MB

tensorflow for ruby

License: BSD 3-Clause "New" or "Revised" License

Ruby 46.80% C++ 9.03% PureBasic 0.30% C 35.14% Python 2.02% Shell 3.59% Dockerfile 2.51% SWIG 0.61%

tensorflow.rb's People

Contributors

arafatkatze avatar ashtono avatar chrhansen avatar geoffreylitt avatar gitter-badger avatar hailiangwangutd avatar hokuma avatar jtoy avatar mkdynamic avatar nethsix avatar sebastiandeutsch avatar wgautier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow.rb's Issues

Add support for GradientDescentOptimizer

I'm not sure if this is strictly necessary for the 0.1.0 Milestone, however having at least one optimizer/trainer would be great.

Python documentation:
https://www.tensorflow.org/versions/r0.10/api_docs/python/train.html#GradientDescentOptimizer

Python implementation:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/training/gradient_descent.py#L27

It's probably a good idea (like for most of our other implementations) to follow the design used in the Python API. In the case of GradientDescentOptimizer it looks like they've built an abstract Optimizer-class that GradientDescentOptimizer (and a few other optimizers) inherit from.

Add support for default graph

Retrieving Default Graph
It should be possible to retrieve a default graph See Python doc. This might be the first thing to build as the code for creating ops and running a session would use the "get-default-graph" method.

Creating Ops
Unless explicitly specified nodes should be added to this default graph:

Tensorflow.constant([1.0, 2.0, 3.0], shape: [3], name : 'a')
# or short-hand:
TF.constant([1.0, 2.0, 3.0], shape: [3], name : 'a')

Session
Also, when Session.run is called it should grab the default graph if not explictly specified
https://www.tensorflow.org/versions/r0.10/api_docs/python/client.html#Session.run

Python Graph documentation: https://www.tensorflow.org/versions/r0.10/api_docs/python/framework.html#Graph

Got memory leak error when I use Tensorflow::Tensor.new(array, :float)

When I build an complex tensor using the Tensorflow::Tensor.new(array, :float), I got a memory leak error(seems only happened on a big array). It maybe an memory malloc issue. When I change the data_size of Tensorflow::TF_FLOAT to 4(original value is 8) and the issue will be fixed. Is this a bug or it depends on my local C++ compiler or my usage issue?
Here is the code: https://github.com/somaticio/tensorflow.rb/blob/master/lib/tensorflow/tensor.rb#L76

Warning: TensorFlow library wasn't compiled to use SSE3

When running the first sample code as provided in the introductory blog post inside the docker image, it displays several warnings:

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
[[6.0, 5.5], [57.0, 7.4]]

Is this natural?

Wider Ruby support using FFI

I started playing with TensorFlow a bit today, and of course my first thought was doing it in Ruby.

Because I wanted something that would work with JRuby, my first path was to generate an FFI library. After some struggling with ffi_gen, I managed to generate this...and it worked!

https://gist.github.com/headius/446fc4980bf715bc5b358f1ba881aa80

I worked through some of the basic examples and, as you might expect, I saw an obvious need for better Ruby abstractions around the C API.

So I found tensorflow.rb!

Unfortunately tensorflow.rb uses a C extension. So I ask: why not replace that extension with the FFI code above?

Could we use pre-compiled `libtensorflow.so` provided by Tensorflow official?

https://www.tensorflow.org/install/install_c

Tensorflow is providing a script to download libtensorflow.so for different platforms. I have tried this and it seems to work well, with all tests passing.

Perhaps we could just use this distributed one and skip the bazel building step.

And moreover, the libtensorflow.so and tensorflow.rb could be published to Rubygems, then other users just need one gem install command to get started.

'make install' does not create 'tf/Tensorflow.so' but instead create 'tf'

When we do 'make install' step, the system will do something like:
/usr/bin/install -c -m 0755 Tensorflow.so /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/x86_64-linux/tf

However if the tf/ does not exist thus instead of creating Tensorflow.so in tf/, it just creates Tensorflow.so

The easiest bypass for now is to create 'tf/' in the directory that the install will be prior to doing 'make install'.

Investigating better possibilities.

arithmetic on a pointer to void

When running make I get the following errors:

././files/tf_tensor_helper.cc:43:46: error: arithmetic on a pointer to void
                *(char *)(buffer_data_pointer+i) = file_string[i];

././files/tf_tensor_helper.cc:52:56: error: arithmetic on a pointer to void
                buffer += *(char *)(buffer_data_pointer+i);

././files/tf_tensor_helper.cc:264:39: error: arithmetic on a pointer to void
        auto dst_str = (char *)(cbytes+8);

././files/tf_tensor_helper.cc:274:36: error: arithmetic on a pointer to void
        auto src = (char *)(cbytes + 8);

If I typecast these to char* before the addition I can get the gem to build, but it segfaults when I try to do anything. For instance, here is the backtrace when I try to run the classify_image.rb example:

/Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb:59: [BUG] Segmentation fault at 0x0000012ed5a000
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/CrashReporter                                         
     * /Library/Logs/CrashReporter                                          
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0044 e:000043 CFUNC  :TF_NewTensor_wrapper
c:0004 p:0280 s:0035 e:000032 METHOD /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb:59 [FINISH]
c:0003 p:---- s:0027 e:000026 CFUNC  :new
c:0002 p:0629 s:0021 E:0010e8 EVAL   classify_image.rb:71 [FINISH]
c:0001 p:0000 s:0003 E:000140 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
classify_image.rb:71:in `<main>'
classify_image.rb:71:in `new'
/Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb:59:in `initialize'
/Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb:59:in `TF_NewTensor_wrapper'

-- Machine register context ------------------------------------------------
 rax: 0x000000011743f000 rbx: 0x0000000000126000 rcx: 0x000000000008f000
 rdx: 0x0000000000126000 rdi: 0x00000001174d6000 rsi: 0x000000012ed5a000
 rbp: 0x00007fff4fee2830 rsp: 0x00007fff4fee2830  r8: 0x0000000003000001
  r9: 0x0000000000000003 r10: 0x0000000000000000 r11: 0xffffffffe877c000
 r12: 0x00000001102de120 r13: 0x0000000000000004 r14: 0x000000012ecc3000
 r15: 0x000000011743f000 rip: 0x00007fff91a37f49 rfl: 0x0000000000010206

-- C level backtrace information -------------------------------------------
0   ruby                                0x000000010fee72f4 rb_vm_bugreport + 388
1   ruby                                0x000000010fd8166a rb_bug_context + 490
2   ruby                                0x000000010fe62e9f sigsegv + 175
3   libsystem_platform.dylib            0x00007fff91a3552a _sigtramp + 26
4   libsystem_platform.dylib            0x00007fff91a37f49 _platform_memmove$VARIANT$Haswell + 41

-- Other runtime information -----------------------------------------------

* Loaded script: classify_image.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin15/enc/encdb.bundle
    5 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin15/enc/trans/transdb.bundle
    6 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/unicode_normalize.rb
    7 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin15/rbconfig.rb
    8 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/errors.rb
   12 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/version.rb
   13 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/platform.rb
   15 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/x86_64-darwin15/stringio.bundle
   19 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/specification.rb
   20 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb
   24 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems.rb
   26 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/rubygems/path_support.rb
   27 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/version.rb
   28 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/core_ext/name_error.rb
   29 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/levenshtein.rb
   30 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/jaro_winkler.rb
   31 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checker.rb
   32 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb
   33 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   34 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   35 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
   36 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
   37 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spell_checkers/null_checker.rb
   38 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/formatter.rb
   39 /Users/matthew-mongeau/.rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean.rb
   40 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.bundle
   41 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/opspec.rb
   42 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb
   43 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/graph.rb
   44 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb
   45 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/session_options.rb
   46 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/status.rb
   47 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/operation.rb
   48 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/savedmodel.rb
   49 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/scope.rb
   50 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow/op.rb
   51 /Users/matthew-mongeau/.gem/ruby/2.4.0/gems/tensorflow-0.0.1/lib/tensorflow.rb

'bundle install' for nmatrix fails on MacOS unless user has special compiler flags

@chrhansen , @Arafatk

'bundle install' now breaks (see message below) since nmatrix requires gcc that supports special flags. If we want this gem to be used widely, it may be good to keep additional installation steps to a minimum? Is nmatrix required for accuracy in rspec testing or for performance reason? Would it make sense for someone to have the option to install the gem with nmatrix turned off unless required?

Thanks for your help.

Installing nmatrix 0.2.1 with native extensions                        [27/1864]

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/nethsix/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160711-52226-1
5l5d7y.rb extconf.rb
checking for apparent GNU g++ binary with C++0x/C++11 support... Exception `Runt
imeError' at extconf.rb:141 - You need a version of g++ which supports -std=c++0
x or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-b
rew-gcc.sh to install a more recent g++.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.                                                      [4/1864]
        --curdir
        --ruby=/Users/nethsix/.rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
extconf.rb:141:in `<main>': You need a version of g++ which supports -std=c++0x 
or -std=c++11. If you're on a Mac and using Homebrew, we recommend using mac-bre
w-gcc.sh to install a more recent g++. (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /Users/nethsix/.rvm/gems/ruby-2.2.4@ruby-tens
orflow-nethsix/gems/nmatrix-0.2.1 for inspection.
Results logged to /Users/nethsix/.rvm/gems/ruby-2.2.4@ruby-tensorflow-nethsix/ex
tensions/x86_64-darwin-15/2.2.0/nmatrix-0.2.1/gem_make.out
An error occurred while installing nmatrix (0.2.1), and Bundler cannot continue.
Make sure that `gem install nmatrix -v '0.2.1'` succeeds before bundling.

ArgumentError with no message, trying to reproduce the SavedModel CAPTCHA example

I'm trying to get something very similar to the CAPTCHA example. I built and saved a very simple model in Python using the high-level Estimator API (DNNClassifier). It takes 2 floats and outputs one of two classes. I'm trying to load it in Ruby and make a prediction with it.

I saved it using export_saved_model:

features = {'Float_input_1': tf.placeholder(tf.float32, shape=[1]),
            'Float_input_2': tf.placeholder(tf.float32, shape=[1])}
serving_input_receiver_fn = tf.estimator.export.build_raw_serving_input_receiver_fn(features, default_batch_size=None)
classifier.export_savedmodel(SAVED_MODEL_FOLDER + '_pb', serving_input_receiver_fn, strip_default_attrs=True)

Looking at my saved model using saved_model_cli shows this:

MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:

signature_def['predict']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['Float_input_1'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: Placeholder:0
    inputs['Float_input_2'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: Placeholder_1:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['class_ids'] tensor_info:
        dtype: DT_INT64
        shape: (-1, 1)
        name: dnn/head/predictions/ExpandDims:0
    outputs['classes'] tensor_info:
        dtype: DT_STRING
        shape: (-1, 1)
        name: dnn/head/predictions/str_classes:0
    outputs['logistic'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: dnn/head/predictions/logistic:0
    outputs['logits'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 1)
        name: dnn/logits/BiasAdd:0
    outputs['probabilities'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 2)
        name: dnn/head/predictions/probabilities:0
  Method name is: tensorflow/serving/predict

My Ruby code:

saved_model = Tensorflow::Savedmodel.new
saved_model.LoadSavedModel('saved_model_pb', ['serve'], nil)

input = [0.97, 1.00]
feature1_output = saved_model.graph.operation('Placeholder').output(0)
feature2_output = saved_model.graph.operation('Placeholder_1').output(0)
classes = saved_model.graph.operation('dnn/head/predictions/str_classes').output(0)
# probabilities = saved_model.graph.operation('dnn/head/predictions/probabilities').output(0)

feature1_tensor = Tensorflow::Tensor.new(input[0])
feature2_tensor = Tensorflow::Tensor.new(input[1])
feeds_tensor_to_output_hash = {feature1_output => feature1_tensor,
                               feature2_output => feature2_tensor}
out_tensor = saved_model.session.run(feeds_tensor_to_output_hash, [classes], [])

puts out_tensor

This fails with an ArgumentError without an error message:

2018-05-22 17:07:08.443115: I tensorflow/cc/saved_model/loader.cc:242] Loading SavedModel with tags: { serve }; from: saved_model_pb/saved_model
2018-05-22 17:07:08.447053: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA
2018-05-22 17:07:08.452575: I tensorflow/cc/saved_model/loader.cc:161] Restoring SavedModel bundle.
2018-05-22 17:07:08.453012: I tensorflow/cc/saved_model/loader.cc:171] The specified SavedModel has no variables; no checkpoints were restored.
2018-05-22 17:07:08.453024: I tensorflow/cc/saved_model/loader.cc:196] Running LegacyInitOp on SavedModel bundle.
2018-05-22 17:07:08.475575: I tensorflow/cc/saved_model/loader.cc:291] SavedModel load for tags { serve }; Status: success. Took 33095 microseconds.
rake aborted!
ArgumentError: 
.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/tensorflow.rb-eb3f5bf4f0fd/lib/tensorflow/session.rb:57:in `Session_run'
.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/bundler/gems/tensorflow.rb-eb3f5bf4f0fd/lib/tensorflow/session.rb:57:in `run'
lib/tasks/ml.rake:380:in `block (2 levels) in <top (required)>'

Any idea what I'm doing wrong? The CAPTCHA example and model work fine. I've attached the saved model.

example.rb giving undefined method `length' error

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?

Unable to install with ruby 2.2.5

I am getting the following output on running 'make'

compiling Tensorflow_wrap.cxx
In file included from Tensorflow_wrap.cxx:2733:
././files/tf_tensor_helper.cc:43:46: error: arithmetic on a pointer to void
*(char *)(buffer_data_pointer+i) = file_string[i];
~~~~~~~~~~~~~~~~~~~^
././files/tf_tensor_helper.cc:52:56: error: arithmetic on a pointer to void
buffer += *(char *)(buffer_data_pointer+i);
~~~~~~~~~~~~~~~~~~~^
././files/tf_tensor_helper.cc:264:39: error: arithmetic on a pointer to void
auto dst_str = (char *)(cbytes+8);
~~~~~~^
././files/tf_tensor_helper.cc:274:36: error: arithmetic on a pointer to void
auto src = (char *)(cbytes + 8);
~~~~~~ ^
4 errors generated.
make: *** [Tensorflow_wrap.o] Error 1

Support for Tensorflow r0.12

Recently I found this cool project and installed tensorflow.rb with building libtensorflow.so from latest Tensorflow source, but spec test failed with initializing Session object.
This seems mainly because the C API has been changed as below from Tensorflow r0.12 :

  • TF_SessionWithGraph has been renamed to TF_Session
  • TF_Session has been renamed to TF_DeprecatedSession

So do you have any schedules for supporting r0.12 or should I building libtensorflow.so from previous versions of Tensorflow?

TF_TensorDelete is never called, so there's a memory leak whenever tensors are built.

Using the gem get_process_mem, I noticed that the memory usage by my process was increasing dramatically if I tried to do a large number of predictions (where each prediction creates an input tensor, and calls session.run)

I've tracked this down to line 59 of tensor.rb, which calls the TF_NewTensor_wrapper function. Looking at this, I noticed that in the tensorflow API documentation, it mentions that you must call TF_DeleteTensor whenever you call TF_NewTensor, and then pass in a deallocator function that will clean up any further data after the tensor is deleted. This appears to never occur, so although ruby is deallocating the tensor objects in ruby, the C++ memory is never freed as tensors are not deleted and the memory thats allocated in TF_NewTensor_wrapper is also never freed.

It seems like we need some sort of destructor in tensor.rb that then will call a TF_DeleteTensor_wrapper function that calls TF_DeleteTensor. In addition you'll need to pass in a deallocator function that calls free(data) when you create the tensors. I've experimented with this, but I'm not sure how to do this as ruby doesn't have an easy way to destruct objects.

Image Recognition example not working any more

When I try the image recognition example with newest libtensorflow.so, I got a error below.
BTW, new libtensorflow.so is quite small than previous version like 90MB vs 450MB

`2017-04-06 11:18:59.850190: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-06 11:18:59.850225: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-06 11:18:59.850231: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-04-06 11:18:59.850235: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-06 11:18:59.850238: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Trying to classify image file: ./mysore_palace.jpg
2017-04-06 11:19:00.429785: 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().
No Operation with the name input exists.
No Operation with the name output exists.
/var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:54: [BUG] Segmentation fault at 0x00000000000030
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0039 e:000038 CFUNC :Session_run
c:0003 p:0117 s:0031 e:000030 METHOD /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:54
c:0002 p:0700 s:0019 E:0012d8 EVAL classify_image.rb:79 [FINISH]
c:0001 p:0000 s:0002 E:001fd0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
classify_image.rb:79:in <main>' /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:54:in run'
/var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:54:in `Session_run'

-- Machine register context ------------------------------------------------
RIP: 0x00007f57faa951cd RBP: 0x00007ffc9c39a090 RSP: 0x00007ffc9c399fd0
RAX: 0x0000000000000000 RBX: 0x00007ffc9c39a040 RCX: 0x00007ffc9c39a030
RDX: 0x0000000000000000 RDI: 0x00007ffc9c39a160 RSI: 0x00007ffc9c399fd0
R8: 0x00007ffc9c39a041 R9: 0x00000000cccccccd R10: 0x00007f57fe9c3bb8
R11: 0x00007f57fe9c3b78 R12: 0x00007ffc9c39a160 R13: 0x00007ffc9c39a030
R14: 0x0000000001d6d9a0 R15: 0x0000000000000040 EFL: 0x0000000000010202

-- C level backtrace information -------------------------------------------
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feb53ca5]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feb53edc]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57fea2d944]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feadfc3e]
/lib/x86_64-linux-gnu/libc.so.6 [0x7f57fe6354b0]
/usr/lib/libtensorflow.so(_ZN12_GLOBAL__N_110OutputNameERK9TF_Output.isra.36+0x6d) [0x7f57faa951cd]
/usr/lib/libtensorflow.so(TF_SessionRun+0x1bf) [0x7f57faaa24af]
/var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so(_ZN10tensorflow11Session_runEP10TF_SessionSt6vectorI9TF_OutputSaIS3_EES2_IP9TF_TensorSaIS7_EES5_S2_IP12TF_OperationSaISB_EE+0x223) [0x7f57fcf34ed3] ./files/tf_tensor_helper.cc:202
/var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so(_ZL17_wrap_Session_runiPmm+0x514) [0x7f57fcf47ed4] Tensorflow_wrap.cxx:27336
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feb4150b]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feb45269]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57feb4a142]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3 [0x7f57fea30cfd]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3(ruby_exec_node+0x1d) [0x7f57fea326fd]
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3(ruby_run_node+0x1e) [0x7f57fea3483e]
ruby [0x40087b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f57fe620830]
ruby(_start+0x29) [0x4008a9]

-- Other runtime information -----------------------------------------------

  • Loaded script: classify_image.rb

  • Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/encdb.so
    5 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/trans/transdb.so
    6 /usr/lib/ruby/2.3.0/unicode_normalize.rb
    7 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/rbconfig.rb
    8 /usr/lib/ruby/2.3.0/rubygems/compatibility.rb
    9 /usr/lib/ruby/2.3.0/rubygems/defaults.rb
    10 /usr/lib/ruby/2.3.0/rubygems/deprecate.rb
    11 /usr/lib/ruby/2.3.0/rubygems/errors.rb
    12 /usr/lib/ruby/2.3.0/rubygems/version.rb
    13 /usr/lib/ruby/2.3.0/rubygems/requirement.rb
    14 /usr/lib/ruby/2.3.0/rubygems/platform.rb
    15 /usr/lib/ruby/2.3.0/rubygems/basic_specification.rb
    16 /usr/lib/ruby/2.3.0/rubygems/stub_specification.rb
    17 /usr/lib/ruby/2.3.0/rubygems/util/list.rb
    18 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/stringio.so
    19 /usr/lib/ruby/2.3.0/rubygems/specification.rb
    20 /usr/lib/ruby/2.3.0/rubygems/exceptions.rb
    21 /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb
    22 /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb
    23 /usr/lib/ruby/2.3.0/monitor.rb
    24 /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb
    25 /usr/lib/ruby/2.3.0/rubygems.rb
    26 /usr/lib/ruby/vendor_ruby/did_you_mean/version.rb
    27 /usr/lib/ruby/vendor_ruby/did_you_mean/core_ext/name_error.rb
    28 /usr/lib/ruby/vendor_ruby/did_you_mean/levenshtein.rb
    29 /usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb
    30 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkable.rb
    31 /usr/lib/ruby/2.3.0/delegate.rb
    32 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
    33 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
    34 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/name_error_checkers.rb
    35 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/method_name_checker.rb
    36 /usr/lib/ruby/vendor_ruby/did_you_mean/spell_checkers/null_checker.rb
    37 /usr/lib/ruby/vendor_ruby/did_you_mean/formatter.rb
    38 /usr/lib/ruby/vendor_ruby/did_you_mean.rb
    39 /usr/lib/ruby/2.3.0/rubygems/path_support.rb
    40 /usr/lib/ruby/2.3.0/rubygems/dependency.rb
    41 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
    42 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/opspec.rb
    43 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb
    44 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/graph.rb
    45 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb
    46 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/session_options.rb
    47 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/status.rb
    48 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/operation.rb
    49 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/savedmodel.rb
    50 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/scope.rb
    51 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow/op.rb
    52 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/tensorflow.rb

  • Process memory map:

00400000-00401000 r-xp 00000000 08:01 11528 /usr/bin/ruby2.3
00600000-00601000 r--p 00000000 08:01 11528 /usr/bin/ruby2.3
00601000-00602000 rw-p 00001000 08:01 11528 /usr/bin/ruby2.3
01bff000-199e0000 rw-p 00000000 00:00 0 [heap]
7f578014c000-7f5785c8a000 rw-p 00000000 00:00 0
7f5791306000-7f5796e44000 rw-p 00000000 00:00 0
7f57972df000-7f579c982000 r--s 00000000 08:01 12446 /usr/lib/libtensorflow.so
7f579c982000-7f57a24c2000 rw-p 00000000 00:00 0
7f57a24c2000-7f57a8000000 rw-p 00000000 00:00 0
7f57a8000000-7f57a8021000 rw-p 00000000 00:00 0
7f57a8021000-7f57ac000000 ---p 00000000 00:00 0
7f57ae37a000-7f57aeb5b000 rw-p 00000000 00:00 0
7f57b0000000-7f57b0021000 rw-p 00000000 00:00 0
7f57b0021000-7f57b4000000 ---p 00000000 00:00 0
7f57b4000000-7f57b4021000 rw-p 00000000 00:00 0
7f57b4021000-7f57b8000000 ---p 00000000 00:00 0
7f57b8000000-7f57b8021000 rw-p 00000000 00:00 0
7f57b8021000-7f57bc000000 ---p 00000000 00:00 0
7f57bf7ff000-7f57bf800000 ---p 00000000 00:00 0
7f57bf800000-7f57c0000000 rw-p 00000000 00:00 0
7f57c0000000-7f57c0021000 rw-p 00000000 00:00 0
7f57c0021000-7f57c4000000 ---p 00000000 00:00 0
7f57c4000000-7f57c4021000 rw-p 00000000 00:00 0
7f57c4021000-7f57c8000000 ---p 00000000 00:00 0
7f57c8000000-7f57c8021000 rw-p 00000000 00:00 0
7f57c8021000-7f57cc000000 ---p 00000000 00:00 0
7f57cc000000-7f57cc021000 rw-p 00000000 00:00 0
7f57cc021000-7f57d0000000 ---p 00000000 00:00 0
7f57d0000000-7f57d0021000 rw-p 00000000 00:00 0
7f57d0021000-7f57d4000000 ---p 00000000 00:00 0
7f57d4000000-7f57d4021000 rw-p 00000000 00:00 0
7f57d4021000-7f57d8000000 ---p 00000000 00:00 0
7f57d8000000-7f57d8021000 rw-p 00000000 00:00 0
7f57d8021000-7f57dc000000 ---p 00000000 00:00 0
7f57dc000000-7f57dc021000 rw-p 00000000 00:00 0
7f57dc021000-7f57e0000000 ---p 00000000 00:00 0
7f57e0000000-7f57e0021000 rw-p 00000000 00:00 0
7f57e0021000-7f57e4000000 ---p 00000000 00:00 0
7f57e4200000-7f57e4600000 rw-p 00000000 00:00 0
7f57e47f9000-7f57e47fa000 ---p 00000000 00:00 0
7f57e47fa000-7f57e4ffa000 rw-p 00000000 00:00 0
7f57e4ffa000-7f57e4ffb000 ---p 00000000 00:00 0
7f57e4ffb000-7f57e57fb000 rw-p 00000000 00:00 0
7f57e57fb000-7f57e57fc000 ---p 00000000 00:00 0
7f57e57fc000-7f57e5ffc000 rw-p 00000000 00:00 0
7f57e5ffc000-7f57e5ffd000 ---p 00000000 00:00 0
7f57e5ffd000-7f57e67fd000 rw-p 00000000 00:00 0
7f57e67fd000-7f57e67fe000 ---p 00000000 00:00 0
7f57e67fe000-7f57e6ffe000 rw-p 00000000 00:00 0
7f57e6ffe000-7f57e6fff000 ---p 00000000 00:00 0
7f57e6fff000-7f57e77ff000 rw-p 00000000 00:00 0
7f57e77ff000-7f57e7800000 ---p 00000000 00:00 0
7f57e7800000-7f57e8000000 rw-p 00000000 00:00 0
7f57e8000000-7f57e8021000 rw-p 00000000 00:00 0
7f57e8021000-7f57ec000000 ---p 00000000 00:00 0
7f57ec000000-7f57ec021000 rw-p 00000000 00:00 0
7f57ec021000-7f57f0000000 ---p 00000000 00:00 0
7f57f0000000-7f57f0021000 rw-p 00000000 00:00 0
7f57f0021000-7f57f4000000 ---p 00000000 00:00 0
7f57f41c1000-7f57f4389000 r--s 00000000 08:01 262822 /lib/x86_64-linux-gnu/libc-2.23.so
7f57f4389000-7f57f45f8000 r--s 00000000 08:01 11523 /usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3.0
7f57f45f8000-7f57f45f9000 ---p 00000000 00:00 0
7f57f45f9000-7f57f4df9000 rw-p 00000000 00:00 0
7f57f4df9000-7f57f4dfa000 ---p 00000000 00:00 0
7f57f4dfa000-7f57f55fa000 rw-p 00000000 00:00 0
7f57f55fa000-7f57f55fb000 ---p 00000000 00:00 0
7f57f55fb000-7f57f5dfb000 rw-p 00000000 00:00 0
7f57f5dfb000-7f57f5dfc000 ---p 00000000 00:00 0
7f57f5dfc000-7f57f65fc000 rw-p 00000000 00:00 0
7f57f65fc000-7f57f65fd000 ---p 00000000 00:00 0
7f57f65fd000-7f57f6dfd000 rw-p 00000000 00:00 0
7f57f6dfd000-7f57f6dfe000 ---p 00000000 00:00 0
7f57f6dfe000-7f57f75fe000 rw-p 00000000 00:00 0
7f57f75fe000-7f57f75ff000 ---p 00000000 00:00 0
7f57f75ff000-7f57f7dff000 rw-p 00000000 00:00 0
7f57f7dff000-7f57f7e00000 ---p 00000000 00:00 0
7f57f7e00000-7f57f8600000 rw-p 00000000 00:00 0
7f57f8600000-7f57f8800000 rw-p 00000000 00:00 0
7f57f8800000-7f57f8a00000 rw-p 00000000 00:00 0
7f57f8a23000-7f57f8a39000 r-xp 00000000 08:01 262801 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57f8a39000-7f57f8c38000 ---p 00016000 08:01 262801 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57f8c38000-7f57f8c39000 rw-p 00015000 08:01 262801 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57f8c39000-7f57f8dab000 r-xp 00000000 08:01 149 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f57f8dab000-7f57f8fab000 ---p 00172000 08:01 149 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f57f8fab000-7f57f8fb5000 r--p 00172000 08:01 149 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f57f8fb5000-7f57f8fb7000 rw-p 0017c000 08:01 149 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f57f8fb7000-7f57f8fbb000 rw-p 00000000 00:00 0
7f57f8fbb000-7f57fcdf2000 r-xp 00000000 08:01 12446 /usr/lib/libtensorflow.so
7f57fcdf2000-7f57fcdf3000 ---p 03e37000 08:01 12446 /usr/lib/libtensorflow.so
7f57fcdf3000-7f57fcee6000 r--p 03e37000 08:01 12446 /usr/lib/libtensorflow.so
7f57fcee6000-7f57fcee7000 rw-p 03f2a000 08:01 12446 /usr/lib/libtensorflow.so
7f57fcee7000-7f57fceef000 rw-p 00000000 00:00 0
7f57fceef000-7f57fcf75000 r-xp 00000000 08:01 13805 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7f57fcf75000-7f57fd175000 ---p 00086000 08:01 13805 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7f57fd175000-7f57fd177000 r--p 00086000 08:01 13805 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7f57fd177000-7f57fd17a000 rw-p 00088000 08:01 13805 /var/lib/gems/2.3.0/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7f57fd17a000-7f57fd181000 r-xp 00000000 08:01 143445 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/stringio.so
7f57fd181000-7f57fd380000 ---p 00007000 08:01 143445 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/stringio.so
7f57fd380000-7f57fd381000 r--p 00006000 08:01 143445 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/stringio.so
7f57fd381000-7f57fd382000 rw-p 00007000 08:01 143445 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/stringio.so
7f57fd382000-7f57fd384000 r-xp 00000000 08:01 143504 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/trans/transdb.so
7f57fd384000-7f57fd584000 ---p 00002000 08:01 143504 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/trans/transdb.so
7f57fd584000-7f57fd585000 r--p 00002000 08:01 143504 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/trans/transdb.so
7f57fd585000-7f57fd586000 rw-p 00003000 08:01 143504 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/trans/transdb.so
7f57fd586000-7f57fd588000 r-xp 00000000 08:01 143535 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/encdb.so
7f57fd588000-7f57fd787000 ---p 00002000 08:01 143535 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/encdb.so
7f57fd787000-7f57fd788000 r--p 00001000 08:01 143535 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/encdb.so
7f57fd788000-7f57fd789000 rw-p 00002000 08:01 143535 /usr/lib/x86_64-linux-gnu/ruby/2.3.0/enc/encdb.so
7f57fd789000-7f57fda1e000 r--p 00000000 08:01 1822 /usr/lib/locale/locale-archive
7f57fda1e000-7f57fdb26000 r-xp 00000000 08:01 262809 /lib/x86_64-linux-gnu/libm-2.23.so
7f57fdb26000-7f57fdd25000 ---p 00108000 08:01 262809 /lib/x86_64-linux-gnu/libm-2.23.so
7f57fdd25000-7f57fdd26000 r--p 00107000 08:01 262809 /lib/x86_64-linux-gnu/libm-2.23.so
7f57fdd26000-7f57fdd27000 rw-p 00108000 08:01 262809 /lib/x86_64-linux-gnu/libm-2.23.so
7f57fdd27000-7f57fdd30000 r-xp 00000000 08:01 271223 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7f57fdd30000-7f57fdf2f000 ---p 00009000 08:01 271223 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7f57fdf2f000-7f57fdf30000 r--p 00008000 08:01 271223 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7f57fdf30000-7f57fdf31000 rw-p 00009000 08:01 271223 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7f57fdf31000-7f57fdf5f000 rw-p 00000000 00:00 0
7f57fdf5f000-7f57fdf62000 r-xp 00000000 08:01 262796 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57fdf62000-7f57fe161000 ---p 00003000 08:01 262796 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57fe161000-7f57fe162000 r--p 00002000 08:01 262796 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57fe162000-7f57fe163000 rw-p 00003000 08:01 262796 /lib/x86_64-linux-gnu/libdl-2.23.so
7f57fe163000-7f57fe1e2000 r-xp 00000000 08:01 2363 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f57fe1e2000-7f57fe3e1000 ---p 0007f000 08:01 2363 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f57fe3e1000-7f57fe3e2000 r--p 0007e000 08:01 2363 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f57fe3e2000-7f57fe3e3000 rw-p 0007f000 08:01 2363 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7f57fe3e3000-7f57fe3fb000 r-xp 00000000 08:01 262891 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f57fe3fb000-7f57fe5fa000 ---p 00018000 08:01 262891 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f57fe5fa000-7f57fe5fb000 r--p 00017000 08:01 262891 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f57fe5fb000-7f57fe5fc000 rw-p 00018000 08:01 262891 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f57fe5fc000-7f57fe600000 rw-p 00000000 00:00 0
7f57fe600000-7f57fe7bf000 r-xp 00000000 08:01 262822 /lib/x86_64-linux-gnu/libc-2.23.so
7f57fe7bf000-7f57fe9bf000 ---p 001bf000 08:01 262822 /lib/x86_64-linux-gnu/libc-2.23.so
7f57fe9bf000-7f57fe9c3000 r--p 001bf000 08:01 262822 /lib/x86_64-linux-gnu/libc-2.23.so
7f57fe9c3000-7f57fe9c5000 rw-p 001c3000 08:01 262822 /lib/x86_64-linux-gnu/libc-2.23.so
7f57fe9c5000-7f57fe9c9000 rw-p 00000000 00:00 0
7f57fe9c9000-7f57fec31000 r-xp 00000000 08:01 11523 /usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3.0
7f57fec31000-7f57fee30000 ---p 00268000 08:01 11523 /usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3.0
7f57fee30000-7f57fee36000 r--p 00267000 08:01 11523 /usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3.0
7f57fee36000-7f57fee37000 rw-p 0026d000 08:01 11523 /usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3.0
7f57fee37000-7f57fee47000 rw-p 00000000 00:00 0
7f57fee47000-7f57fee6d000 r-xp 00000000 08:01 262833 /lib/x86_64-linux-gnu/ld-2.23.so
7f57fef5c000-7f57ff062000 rw-p 00000000 00:00 0
7f57ff064000-7f57ff066000 r--s 00000000 08:01 11528 /usr/bin/ruby2.3
7f57ff066000-7f57ff067000 ---p 00000000 00:00 0
7f57ff067000-7f57ff06c000 rw-p 00000000 00:00 0
7f57ff06c000-7f57ff06d000 r--p 00025000 08:01 262833 /lib/x86_64-linux-gnu/ld-2.23.so
7f57ff06d000-7f57ff06e000 rw-p 00026000 08:01 262833 /lib/x86_64-linux-gnu/ld-2.23.so
7f57ff06e000-7f57ff06f000 rw-p 00000000 00:00 0
7ffc9bb9d000-7ffc9c39c000 rw-p 00000000 00:00 0 [stack]
7ffc9c3d5000-7ffc9c3d7000 r--p 00000000 00:00 0 [vvar]
7ffc9c3d7000-7ffc9c3d9000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
`

more example

Is possible to add simple xor example
and meybe normal mnist digit?

Add support for Multi Dimensional Tensors for String Data type in tensor

A good solution to this problem was released in #26. But somehow it's a hack:

  • It's actually assuming that there are strings in the tensor.
  • It currently can't deal with multi dimensional string arrays.
  • Encoding issues of strings are not covered.
    Its best, if we were to have a complete solution for this.

Resolve Installation issues across multiple platforms and release Docker containers

Currently, Tensorflow.rb works perfectly on fresh Ubuntu 14, 16 versions as tested on Virtual Machines.
However, the installation process takes a lot of time and new users face installation issues with Mac OS.

Our goal is to resolve the installation issues across various Operating systems and also release Docker container to resolve these issues all together.

License?

It looks like this project doesn't have an explicit license noted yet. I know it's still early, but I think it's important to have a license so that potential users and contributors can be assured about the legal status of this code.

I don't know enough about the background of where this project came from to suggest which license might be appropriate, but this website is fairly informative.

Graph addition of strings test failed

Hi,
First of ll congratulations for the fantastic work you have done with this Ruby interface to TensorFlow.
I just wanted to report I got today. A couple of days ago I went through the installation process step by step and it worked like a charm including the test suite at the end invoked through the "bundle exec rake test" command.
Today I decided I had enough with those warnings from the TensorFlow library telling me that I wasn't using all the nice SIMD instruction set available on my CPU and I decided to recompile TF with the following options:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.1 --copt=-msse4.2 //tensorflow:libtensorflow.so

Everything went well except that after rebuilding the Ruvy extension all test passed successfully except this one below. Any idea why this is happening ?

Failures:

  1) Graph Addition of strings
     Failure/Error: expect(out_tensor[0]).to eq('TensorflowRuby')

       expected: "TensorflowRuby"
            got: "TensorflowRubylowRuby"

       (compared using ==)
     # ./spec/graph_spec.rb:29:in `block (2 levels) in <top (required)>'

Finished in 0.08098 seconds (files took 0.21106 seconds to load)
70 examples, 1 failure

Failed examples:
rspec ./spec/graph_spec.rb:21 # Graph Addition of strings

RubyML

Dear @Arafatk ,

we've recently added tensorflow to our RubyML list: https://github.com/arbox/machine-learning-with-ruby

In order to connect all Ruby & ML related projects we introduced the rubyml topic on GitHub.

Please cosider adding the rubyml topic to this repository as well so that the Ruby community can discover this project faster ๐Ÿ˜ƒ

Thank you in advance!

Spec fails unpredictably

For some reason the string data spec fails. When I run it for the first time I get these results:

/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/ruby -I/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/lib:/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-support-3.4.1/lib /Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
............................................F

Failures:

  1) Tensorflow::Tensor Should make tensor of string data type.
     Failure/Error: expect(["Ruby", "Tensorflow", "is", "cool"]).to match_array(Tensorflow::string_reader(input1.tensor))

       expected collection contained:  ["", "Ruby", "Tensorf\xD8F7", "\xD6\x94\xAE\x99\x7F\x00\x00\xC0%\x84\xAF\x99\x7F\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x06<\xF8\x9A\xF9\a\x00\xF0\xBE\x0F\xF8\x9A\xF9\a\x000\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x00\x000\x1D\x00\x8F\xAF\x99\x7F\x00\x00\x00"]
       actual collection contained:    ["Ruby", "Tensorflow", "cool", "is"]
       the missing elements were:      ["", "Tensorf\xD8F7", "\xD6\x94\xAE\x99\x7F\x00\x00\xC0%\x84\xAF\x99\x7F\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x06<\xF8\x9A\xF9\a\x00\xF0\xBE\x0F\xF8\x9A\xF9\a\x000\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x00\x000\x1D\x00\x8F\xAF\x99\x7F\x00\x00\x00"]
       the extra elements were:        ["Tensorflow", "cool", "is"]
     # ./spec/tensor_spec.rb:19:in `block (2 levels) in <top (required)>'

Finished in 0.42225 seconds (files took 0.32834 seconds to load)
45 examples, 1 failure

Failed examples:

rspec ./spec/tensor_spec.rb:17 # Tensorflow::Tensor Should make tensor of string data type.

/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/ruby -I/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/lib:/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-support-3.4.1/lib /Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed

When I run it again I get this error:

/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/ruby -I/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/lib:/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-support-3.4.1/lib /Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
............................................ruby(7394,0x7fff774d5000) malloc: *** mach_vm_map(size=140481453690880) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/ruby -I/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/lib:/Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-support-3.4.1/lib /Users/sebastiandeutsch/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.4.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
rake aborted!
TypeError: no implicit conversion from nil to integer
/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
/Users/sebastiandeutsch/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
Tasks: TOP => spec
(See full trace by running task with --trace)

I'm running OSX (El Capitain)

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] using rbenv
tensorflow at d2c913aa9b7cb63e466392f76d46ac5fbc1e9825

Docker image failing with Segmentation fault error on running classify_image.rb

Here's the log:

`root@c8f53aedb9b3:/repos/tensorflow.rb/image# ruby classify_image.rb
E tensorflow/core/client/tensor_c_api.cc:485] FeedInputs: unable to find feed output Mul
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:103: [BUG] Segmentation fault at 0x00000000000017
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0007 p:---- s:0043 e:000042 CFUNC :tensor_size
c:0006 p:0015 s:0039 e:000038 METHOD /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:103
c:0005 p:0009 s:0032 e:000031 BLOCK /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:42 [FINISH]
c:0004 p:---- s:0028 e:000027 CFUNC :each
c:0003 p:0125 s:0025 e:000024 METHOD /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:41
c:0002 p:0132 s:0012 E:0026e0 EVAL classify_image.rb:37 [FINISH]
c:0001 p:0000 s:0002 E:001b10 TOP [FINISH]

-- Ruby level backtrace information ----------------------------------------
classify_image.rb:37:in <main>' /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:41:in run'
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:41:in each' /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:42:in block in run'
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:103:in convert_value_for_output_array' /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:103:in tensor_size'

-- Machine register context ------------------------------------------------
RIP: 0x00007fc343f96fde RBP: 0x00007ffc763966f0 RSP: 0x00007ffc763966e0
RAX: 0x0000000000000017 RBX: 0x0000000000000001 RCX: 0x0000000000000000
RDX: 0x00007fc3494923a0 RDI: 0x0000000000000008 RSI: 0x00007ffc76396938
R8: 0x0000000000000000 R9: 0x00007fc34b6481b0 R10: 0x00007fc34b747e30
R11: 0x0000000001b279a0 R12: 0x00007fc34b747e30 R13: 0x0000000001a893b0
R14: 0x000000000180fce0 R15: 0x0000000001a87470 EFL: 0x0000000000010216

-- C level backtrace information -------------------------------------------
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(rb_vm_bugreport+0x4ea) [0x7fc34b24178a] vm_dump.c:693
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(rb_bug_context+0xcb) [0x7fc34b0dc91b] error.c:425
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(sigsegv+0x3e) [0x7fc34b1ba0ce] signal.c:879
/lib/x86_64-linux-gnu/libc.so.6 [0x7fc34accd4a0]
/usr/lib/libtensorflow.so(_ZNK10tensorflow11TensorShape3tagEv+0x1c) [0x7fc343f96fde]
/usr/lib/libtensorflow.so(_ZNK10tensorflow11TensorShape4dimsEv+0x31) [0x7fc343f96ead]
/usr/lib/libtensorflow.so(TF_NumDims+0x1c) [0x7fc3463411a0]
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so(_ZN10tensorflow11tensor_sizeEP9TF_Tensor+0x18) [0x7fc34921e7db]
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so [0x7fc349249a4d]
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_call_cfunc+0x122) [0x7fc34b22a192] vm_insnhelper.c:1380
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_exec_core+0x1373) [0x7fc34b230a73] insns.def:1070
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_exec+0x7b) [0x7fc34b2354ab] vm.c:1435
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(invoke_block_from_c+0x3cc) [0x7fc34b239f2c] vm.c:813
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(rb_yield+0x5b) [0x7fc34b23a90b] vm.c:853
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so [0x7fc3492238d0]
/usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so [0x7fc3492381fd]
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_call_cfunc+0x122) [0x7fc34b22a192] vm_insnhelper.c:1380
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_exec_core+0x12c8) [0x7fc34b2309c8] insns.def:1040
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(vm_exec+0x7b) [0x7fc34b2354ab] vm.c:1435
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(rb_iseq_eval_main+0x203) [0x7fc34b236a03] vm.c:1680
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(ruby_exec_internal+0xbd) [0x7fc34b0e216d] eval.c:252
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(ruby_exec_node+0x1d) [0x7fc34b0e467d] eval.c:317
/usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2(ruby_run_node+0x1e) [0x7fc34b0e6e4e] eval.c:309
/usr/local/rvm/rubies/ruby-2.2.4/bin/ruby(main+0x4b) [0x40087b] main.c:36

-- Other runtime information -----------------------------------------------

  • Loaded script: classify_image.rb

  • Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/encdb.so
    4 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/trans/transdb.so
    5 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/unicode_normalize.rb
    6 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/rbconfig.rb
    7 thread.rb
    8 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/thread.so
    9 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/compatibility.rb
    10 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/defaults.rb
    11 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/deprecate.rb
    12 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/errors.rb
    13 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/version.rb
    14 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/requirement.rb
    15 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/platform.rb
    16 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb
    17 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/stub_specification.rb
    18 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/util/stringio.rb
    19 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb
    20 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/exceptions.rb
    21 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
    22 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/monitor.rb
    23 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb
    24 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems.rb
    25 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/path_support.rb
    26 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb
    27 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/stringio.so
    28 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/version.rb
    29 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/enum.rb
    30 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/varint.rb
    31 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/limited_io.rb
    32 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/field.rb
    33 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/encoder.rb
    34 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/decoder.rb
    35 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/text_formatter.rb
    36 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/racc/cparse.so
    37 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/racc/parser.rb
    38 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/strscan.so
    39 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/text_scanner.rb
    40 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/text_parser.rb
    41 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/message.rb
    42 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/rpc.rb
    43 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers/runtime/service.rb
    44 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/ruby-protocol-buffers-1.6.1/lib/protocol_buffers.rb
    45 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/tensor_shape.pb.rb
    46 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/types.pb.rb
    47 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/tensor.pb.rb
    48 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/attr_value.pb.rb
    49 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/op_def.pb.rb
    50 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/function.pb.rb
    51 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/versions.pb.rb
    52 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/core/framework/graph.pb.rb
    53 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
    54 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray/nmatrix.rb
    55 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray/narray_ext.rb
    56 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray.so
    57 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/tensor.rb
    58 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/graph.rb
    59 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow/session.rb
    60 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/tensorflow.rb

  • Process memory map:

00400000-00401000 r-xp 00000000 08:01 3412249 /usr/local/rvm/rubies/ruby-2.2.4/bin/ruby
00600000-00601000 r--p 00000000 08:01 3412249 /usr/local/rvm/rubies/ruby-2.2.4/bin/ruby
00601000-00602000 rw-p 00001000 08:01 3412249 /usr/local/rvm/rubies/ruby-2.2.4/bin/ruby
017dc000-0b807000 rw-p 00000000 00:00 0 [heap]
7fc2e82a0000-7fc300298000 r--s 00000000 08:01 3035139 /usr/lib/libtensorflow.so
7fc300298000-7fc305e99000 rw-p 00000000 00:00 0
7fc30b183000-7fc30b34b000 r--s 00000000 08:01 2239031 /lib/x86_64-linux-gnu/libc-2.23.so
7fc30b34b000-7fc30c000000 r--s 00000000 08:01 3412286 /usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2.0
7fc30c000000-7fc30c20d000 rw-p 00000000 00:00 0
7fc30c20d000-7fc310000000 ---p 00000000 00:00 0
7fc3100aa000-7fc314000000 rw-p 00000000 00:00 0
7fc314000000-7fc314021000 rw-p 00000000 00:00 0
7fc314021000-7fc318000000 ---p 00000000 00:00 0
7fc318000000-7fc318021000 rw-p 00000000 00:00 0
7fc318021000-7fc31c000000 ---p 00000000 00:00 0
7fc31c000000-7fc31c021000 rw-p 00000000 00:00 0
7fc31c021000-7fc320000000 ---p 00000000 00:00 0
7fc320000000-7fc320021000 rw-p 00000000 00:00 0
7fc320021000-7fc324000000 ---p 00000000 00:00 0
7fc324000000-7fc324021000 rw-p 00000000 00:00 0
7fc324021000-7fc328000000 ---p 00000000 00:00 0
7fc328000000-7fc328021000 rw-p 00000000 00:00 0
7fc328021000-7fc32c000000 ---p 00000000 00:00 0
7fc32c000000-7fc32c021000 rw-p 00000000 00:00 0
7fc32c021000-7fc330000000 ---p 00000000 00:00 0
7fc330017000-7fc330ffa000 rw-p 00000000 00:00 0
7fc330ffa000-7fc330ffb000 ---p 00000000 00:00 0
7fc330ffb000-7fc3317fb000 rw-p 00000000 00:00 0
7fc3317fb000-7fc3317fc000 ---p 00000000 00:00 0
7fc3317fc000-7fc331ffc000 rw-p 00000000 00:00 0
7fc331ffc000-7fc331ffd000 ---p 00000000 00:00 0
7fc331ffd000-7fc3327fd000 rw-p 00000000 00:00 0
7fc3327fd000-7fc3327fe000 ---p 00000000 00:00 0
7fc3327fe000-7fc332ffe000 rw-p 00000000 00:00 0
7fc332ffe000-7fc332fff000 ---p 00000000 00:00 0
7fc332fff000-7fc3337ff000 rw-p 00000000 00:00 0
7fc3337ff000-7fc333800000 ---p 00000000 00:00 0
7fc333800000-7fc334000000 rw-p 00000000 00:00 0
7fc334000000-7fc334021000 rw-p 00000000 00:00 0
7fc334021000-7fc338000000 ---p 00000000 00:00 0
7fc3380ff000-7fc338100000 ---p 00000000 00:00 0
7fc338100000-7fc338900000 rw-p 00000000 00:00 0
7fc338900000-7fc338901000 ---p 00000000 00:00 0
7fc338901000-7fc339101000 rw-p 00000000 00:00 0
7fc339101000-7fc339102000 ---p 00000000 00:00 0
7fc339102000-7fc339902000 rw-p 00000000 00:00 0
7fc339902000-7fc33993a000 r-xp 00000000 08:01 3539588 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray.so
7fc33993a000-7fc339b39000 ---p 00038000 08:01 3539588 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray.so
7fc339b39000-7fc339b3a000 r--p 00037000 08:01 3539588 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray.so
7fc339b3a000-7fc339b3d000 rw-p 00038000 08:01 3539588 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/narray-0.6.1.2/narray.so
7fc339b3d000-7fc339b3e000 rw-p 00000000 00:00 0
7fc339b3e000-7fc339b57000 r-xp 00000000 08:01 2239229 /lib/x86_64-linux-gnu/libz.so.1.2.8
7fc339b57000-7fc339d56000 ---p 00019000 08:01 2239229 /lib/x86_64-linux-gnu/libz.so.1.2.8
7fc339d56000-7fc339d57000 r--p 00018000 08:01 2239229 /lib/x86_64-linux-gnu/libz.so.1.2.8
7fc339d57000-7fc339d58000 rw-p 00019000 08:01 2239229 /lib/x86_64-linux-gnu/libz.so.1.2.8
7fc339d58000-7fc339d6e000 r-xp 00000000 08:01 2239150 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fc339d6e000-7fc339f6d000 ---p 00016000 08:01 2239150 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fc339f6d000-7fc339f6e000 rw-p 00015000 08:01 2239150 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fc339f6e000-7fc33a0e0000 r-xp 00000000 08:01 2371253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7fc33a0e0000-7fc33a2e0000 ---p 00172000 08:01 2371253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7fc33a2e0000-7fc33a2ea000 r--p 00172000 08:01 2371253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7fc33a2ea000-7fc33a2ec000 rw-p 0017c000 08:01 2371253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7fc33a2ec000-7fc33a2f0000 rw-p 00000000 00:00 0
7fc33a2f0000-7fc348cc4000 r-xp 00000000 08:01 3035139 /usr/lib/libtensorflow.so
7fc348cc4000-7fc348ec3000 ---p 0e9d4000 08:01 3035139 /usr/lib/libtensorflow.so
7fc348ec3000-7fc348f50000 r--p 0e9d3000 08:01 3035139 /usr/lib/libtensorflow.so
7fc348f50000-7fc3491d0000 rw-p 0ea60000 08:01 3035139 /usr/lib/libtensorflow.so
7fc3491d0000-7fc3491d3000 rw-p 00000000 00:00 0
7fc3491d3000-7fc34928f000 r-xp 00000000 08:01 3542562 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7fc34928f000-7fc34948e000 ---p 000bc000 08:01 3542562 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7fc34948e000-7fc34948f000 r--p 000bb000 08:01 3542562 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7fc34948f000-7fc349494000 rw-p 000bc000 08:01 3542562 /usr/local/rvm/gems/ruby-2.2.4@ruby-tensorflow/gems/tensorflow-0.0.1/lib/sciruby/Tensorflow.so
7fc349494000-7fc349495000 rw-p 00000000 00:00 0
7fc349495000-7fc34949b000 r-xp 00000000 08:01 3413246 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/strscan.so
7fc34949b000-7fc34969a000 ---p 00006000 08:01 3413246 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/strscan.so
7fc34969a000-7fc34969b000 r--p 00005000 08:01 3413246 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/strscan.so
7fc34969b000-7fc34969c000 rw-p 00006000 08:01 3413246 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/strscan.so
7fc34969c000-7fc3496a0000 r-xp 00000000 08:01 3413237 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/racc/cparse.so
7fc3496a0000-7fc34989f000 ---p 00004000 08:01 3413237 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/racc/cparse.so
7fc34989f000-7fc3498a0000 r--p 00003000 08:01 3413237 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/racc/cparse.so
7fc3498a0000-7fc3498a1000 rw-p 00004000 08:01 3413237 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/racc/cparse.so
7fc3498a1000-7fc3498a9000 r-xp 00000000 08:01 3413245 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/stringio.so
7fc3498a9000-7fc349aa8000 ---p 00008000 08:01 3413245 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/stringio.so
7fc349aa8000-7fc349aa9000 r--p 00007000 08:01 3413245 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/stringio.so
7fc349aa9000-7fc349aaa000 rw-p 00008000 08:01 3413245 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/stringio.so
7fc349aaa000-7fc349aad000 r-xp 00000000 08:01 3413248 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/thread.so
7fc349aad000-7fc349cad000 ---p 00003000 08:01 3413248 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/thread.so
7fc349cad000-7fc349cae000 r--p 00003000 08:01 3413248 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/thread.so
7fc349cae000-7fc349caf000 rw-p 00004000 08:01 3413248 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/thread.so
7fc349caf000-7fc349cb1000 r-xp 00000000 08:01 3413205 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/trans/transdb.so
7fc349cb1000-7fc349eb1000 ---p 00002000 08:01 3413205 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/trans/transdb.so
7fc349eb1000-7fc349eb2000 r--p 00002000 08:01 3413205 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/trans/transdb.so
7fc349eb2000-7fc349eb3000 rw-p 00003000 08:01 3413205 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/trans/transdb.so
7fc349eb3000-7fc349eb5000 r-xp 00000000 08:01 3413163 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/encdb.so
7fc349eb5000-7fc34a0b4000 ---p 00002000 08:01 3413163 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/encdb.so
7fc34a0b4000-7fc34a0b5000 r--p 00001000 08:01 3413163 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/encdb.so
7fc34a0b5000-7fc34a0b6000 rw-p 00002000 08:01 3413163 /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-linux/enc/encdb.so
7fc34a0b6000-7fc34a1be000 r-xp 00000000 08:01 2239161 /lib/x86_64-linux-gnu/libm-2.23.so
7fc34a1be000-7fc34a3bd000 ---p 00108000 08:01 2239161 /lib/x86_64-linux-gnu/libm-2.23.so
7fc34a3bd000-7fc34a3be000 r--p 00107000 08:01 2239161 /lib/x86_64-linux-gnu/libm-2.23.so
7fc34a3be000-7fc34a3bf000 rw-p 00108000 08:01 2239161 /lib/x86_64-linux-gnu/libm-2.23.so
7fc34a3bf000-7fc34a3c8000 r-xp 00000000 08:01 2239039 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7fc34a3c8000-7fc34a5c7000 ---p 00009000 08:01 2239039 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7fc34a5c7000-7fc34a5c8000 r--p 00008000 08:01 2239039 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7fc34a5c8000-7fc34a5c9000 rw-p 00009000 08:01 2239039 /lib/x86_64-linux-gnu/libcrypt-2.23.so
7fc34a5c9000-7fc34a5f7000 rw-p 00000000 00:00 0
7fc34a5f7000-7fc34a5fa000 r-xp 00000000 08:01 2239044 /lib/x86_64-linux-gnu/libdl-2.23.so
7fc34a5fa000-7fc34a7f9000 ---p 00003000 08:01 2239044 /lib/x86_64-linux-gnu/libdl-2.23.so
7fc34a7f9000-7fc34a7fa000 r--p 00002000 08:01 2239044 /lib/x86_64-linux-gnu/libdl-2.23.so
7fc34a7fa000-7fc34a7fb000 rw-p 00003000 08:01 2239044 /lib/x86_64-linux-gnu/libdl-2.23.so
7fc34a7fb000-7fc34a87a000 r-xp 00000000 08:01 1586083 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7fc34a87a000-7fc34aa79000 ---p 0007f000 08:01 1586083 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7fc34aa79000-7fc34aa7a000 r--p 0007e000 08:01 1586083 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7fc34aa7a000-7fc34aa7b000 rw-p 0007f000 08:01 1586083 /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
7fc34aa7b000-7fc34aa93000 r-xp 00000000 08:01 2239198 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fc34aa93000-7fc34ac92000 ---p 00018000 08:01 2239198 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fc34ac92000-7fc34ac93000 r--p 00017000 08:01 2239198 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fc34ac93000-7fc34ac94000 rw-p 00018000 08:01 2239198 /lib/x86_64-linux-gnu/libpthread-2.23.so
7fc34ac94000-7fc34ac98000 rw-p 00000000 00:00 0
7fc34ac98000-7fc34ae58000 r-xp 00000000 08:01 2239031 /lib/x86_64-linux-gnu/libc-2.23.so
7fc34ae58000-7fc34b057000 ---p 001c0000 08:01 2239031 /lib/x86_64-linux-gnu/libc-2.23.so
7fc34b057000-7fc34b05b000 r--p 001bf000 08:01 2239031 /lib/x86_64-linux-gnu/libc-2.23.so
7fc34b05b000-7fc34b05d000 rw-p 001c3000 08:01 2239031 /lib/x86_64-linux-gnu/libc-2.23.so
7fc34b05d000-7fc34b061000 rw-p 00000000 00:00 0
7fc34b061000-7fc34b31a000 r-xp 00000000 08:01 3412286 /usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2.0
7fc34b31a000-7fc34b51a000 ---p 002b9000 08:01 3412286 /usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2.0
7fc34b51a000-7fc34b51f000 r--p 002b9000 08:01 3412286 /usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2.0
7fc34b51f000-7fc34b522000 rw-p 002be000 08:01 3412286 /usr/local/rvm/rubies/ruby-2.2.4/lib/libruby.so.2.2.0
7fc34b522000-7fc34b533000 rw-p 00000000 00:00 0
7fc34b533000-7fc34b559000 r-xp 00000000 08:01 2239011 /lib/x86_64-linux-gnu/ld-2.23.so
7fc34b625000-7fc34b648000 r--s 00000000 08:01 3412249 /usr/local/rvm/rubies/ruby-2.2.4/bin/ruby
7fc34b648000-7fc34b74e000 rw-p 00000000 00:00 0
7fc34b752000-7fc34b753000 ---p 00000000 00:00 0
7fc34b753000-7fc34b758000 rw-p 00000000 00:00 0
7fc34b758000-7fc34b759000 r--p 00025000 08:01 2239011 /lib/x86_64-linux-gnu/ld-2.23.so
7fc34b759000-7fc34b75a000 rw-p 00026000 08:01 2239011 /lib/x86_64-linux-gnu/ld-2.23.so
7fc34b75a000-7fc34b75b000 rw-p 00000000 00:00 0
7ffc75b9a000-7ffc76399000 rw-p 00000000 00:00 0 [stack]
7ffc763af000-7ffc763b1000 r--p 00000000 00:00 0 [vvar]
7ffc763b1000-7ffc763b3000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Aborted
root@c8f53aedb9b3:/repos/tensorflow.rb/image#`

Add #device to place ops on specific named devices

Used in "Basic Usage" here: https://www.tensorflow.org/versions/r0.10/get_started/basic_usage.html e.g.:

with tf.device('/gpu:2'):
  tf.constant([1.0, 2.0, 3.0], shape=[3], name='a')

Could be something like (using default-graph if not explicitly specified) this in Ruby:

Tensorflow.device('/gpu:2') do
  graph.constant([1.0, 2.0, 3.0], shape: [3], name : 'a')
end

Python API: https://www.tensorflow.org/versions/r0.10/how_tos/using_gpu/index.html#supported-devices

All of the Medium.com examples that call run fail with error undefined method 'c'

Note: This is not an issue that will require code changes, however it is extremely confusing that the few examples linked to in the main README do not work anymore. Are there any up-to-date examples of how to use the run command other than the one in the image classification example?

It appears that the run method has been changed since the examples on medium.com were all posted.

Now, anywhere that calls run breaks because the examples are passing in a dict of name => tensor inputs, and run now calls: port.c on each input.

This results in the following error:

/usr/local/rvm/gems/ruby-2.2.0/gems/tensorflow-0.0.1/lib/tensorflow/session.rb:40:in `block in run': undefined method `c' for "input1":String (NoMethodError)

First release

Hi
Why the project is not active?
And when we will have the first release?

got extconf.rb failed - when ran "ruby extconf.rb"

Hi All,

I got the error message below when trying to install tensorflow.rb(1st step):

tensorflow_c git:(master) โœ— ruby extconf.rb                                
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/esu/.rbenv/versions/2.3.0/bin/$(RUBY_BASE_NAME)

I couldnt find mkmf.log in tensorflow_c folder

โžœ  tensorflow_c git:(master) โœ— ll
total 24
-rw-r--r--  1 esu  staff   949B Oct  1 22:38 Tensorflow.i
-rw-r--r--  1 esu  staff   1.4K Oct  1 22:38 converter.py
-rw-r--r--  1 esu  staff   188B Oct  1 22:38 extconf.rb
drwxr-xr-x  6 esu  staff   204B Oct  1 22:38 files

kindly please advise

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.