j.eval('ENV["PYTHON"]=""')
j.eval('Pkg.update()')
j.eval('Pkg.add("PyCall")')
j.eval('pyimport_conda("google.protobuf","protobuf")')
=> nil
> j.eval('pyimport_conda("tensorflow","tensorflow","conda-forge")')
=> nil
> j.eval('@pyimport tensorflow as tf')')
* ;
* ^C
> j.eval('@pyimport tensorflow as tf')
=> nil
> j.eval('sess = tf.Session()')
=> nil
> j.eval('a = tf.constant(10)')
=> nil
> j.eval('b = tf.constant(32)')
=> nil
> j.eval('sess[:run](pyeval("a + b", a=a, b=b))')
=> nil
> j.eval('string(sess[:run](pyeval("a + b", a=a, b=b)))')
=> "42"
>
Created
October 21, 2016 03:21
-
-
Save kjunichi/7cb6993575fd67759b46f62f36fcc2ff to your computer and use it in GitHub Desktop.
mrubyでtensorflowをうごかす
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment