deepmind / sonnet Goto Github PK
View Code? Open in Web Editor NEWTensorFlow-based neural network library
Home Page: https://sonnet.dev/
License: Apache License 2.0
TensorFlow-based neural network library
Home Page: https://sonnet.dev/
License: Apache License 2.0
I have a failure when running
bazel build --config=opt :install
on Ubuntu
(tensorflow-1.0.1)sj@vipa-Precision-Tower-7910:~/software/sonnet$ bazel build --strategy=CppCompile=standalone --verbose_failures --config=opt :install
WARNING: Config values are not defined in any .rc file: opt
WARNING: /home/sj/.cache/bazel/_bazel_sj/be13dc62f2ab4b36343926cedc20e2d6/external/org_tensorflow/tensorflow/workspace.bzl:72:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
WARNING: /home/sj/software/sonnet/sonnet/python/BUILD:127:1: in srcs attribute of cc_binary rule //sonnet/python:ops/_resampler.so: please do not import '//sonnet/cc:ops/resampler.cc' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /home/sj/software/sonnet/sonnet/tensorflow.bzl:108:25.
WARNING: /home/sj/software/sonnet/sonnet/python/BUILD:127:1: in srcs attribute of cc_binary rule //sonnet/python:ops/resampler.so: please do not import '//sonnet/cc/kernels:resampler_op.cc' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /home/sj/software/sonnet/sonnet/tensorflow.bzl:108:25.
WARNING: /home/sj/software/sonnet/sonnet/python/BUILD:127:1: in srcs attribute of cc_binary rule //sonnet/python:ops/resampler.so: please do not import '//sonnet/cc/kernels:resampler_op.h' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /home/sj/software/sonnet/sonnet/tensorflow.bzl:108:25.
INFO: Found 1 target...
ERROR: /home/sj/.cache/bazel/bazel_sj/be13dc62f2ab4b36343926cedc20e2d6/external/org_tensorflow/tensorflow/core/BUILD:1150:1: C++ compilation of rule '@org_tensorflow//tensorflow/core:lib_internal' failed: gcc failed: error executing command
(cd /home/sj/.cache/bazel/bazel_sj/be13dc62f2ab4b36343926cedc20e2d6/execroot/sonnet &&
exec env -
LD_LIBRARY_PATH=/home/sj/software/opencv_2.4.9/lib/:/usr/local/cuda-8.0/lib64
PATH=/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -MD -MF bazel-out/host/bin/external/org_tensorflow/tensorflow/core/objs/lib_internal/external/org_tensorflow/tensorflow/core/lib/strings/str_util.d '-frandom-seed=bazel-out/host/bin/external/org_tensorflow/tensorflow/core/objs/lib_internal/external/org_tensorflow/tensorflow/core/lib/strings/str_util.o' -DEIGEN_MPL2_ONLY -iquote external/org_tensorflow -iquote bazel-out/host/genfiles/external/org_tensorflow -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -iquote external/protobuf -iquote bazel-out/host/genfiles/external/protobuf -iquote external/eigen_archive -iquote bazel-out/host/genfiles/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/host/genfiles/external/local_config_sycl -iquote external/gif_archive -iquote bazel-out/host/genfiles/external/gif_archive -iquote external/jpeg -iquote bazel-out/host/genfiles/external/jpeg -iquote external/com_googlesource_code_re2 -iquote bazel-out/host/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/host/genfiles/external/farmhash_archive -iquote external/highwayhash -iquote bazel-out/host/genfiles/external/highwayhash -iquote external/png_archive -iquote bazel-out/host/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/host/genfiles/external/zlib_archive -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/protobuf/src -isystem bazel-out/host/genfiles/external/protobuf/src -isystem external/eigen_archive -isystem bazel-out/host/genfiles/external/eigen_archive -isystem external/gif_archive/lib -isystem bazel-out/host/genfiles/external/gif_archive/lib -isystem external/farmhash_archive/src -isystem bazel-out/host/genfiles/external/farmhash_archive/src -isystem external/png_archive -isystem bazel-out/host/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/host/genfiles/external/zlib_archive -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions -msse3 -pthread -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP="redacted"' '-D__TIME="redacted"' -c external/org_tensorflow/tensorflow/core/lib/strings/str_util.cc -o bazel-out/host/bin/external/org_tensorflow/tensorflow/core/_objs/lib_internal/external/org_tensorflow/tensorflow/core/lib/strings/str_util.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from external/org_tensorflow/tensorflow/core/lib/gtl/array_slice.h:101:0,
from external/org_tensorflow/tensorflow/core/lib/strings/str_util.h:23,
from external/org_tensorflow/tensorflow/core/lib/strings/str_util.cc:16:
external/org_tensorflow/tensorflow/core/lib/gtl/array_slice_internal.h:232:38: error: 'tensorflow::gtl::array_slice_internal::ArraySliceImplBase::ArraySliceImplBase' names constructor
external/org_tensorflow/tensorflow/core/lib/gtl/array_slice_internal.h:252:32: error: 'tensorflow::gtl::array_slice_internal::ArraySliceImplBase::ArraySliceImplBase' names constructor
In file included from external/org_tensorflow/tensorflow/core/lib/gtl/array_slice.h:102:0,
from external/org_tensorflow/tensorflow/core/lib/strings/str_util.h:23,
from external/org_tensorflow/tensorflow/core/lib/strings/str_util.cc:16:
external/org_tensorflow/tensorflow/core/lib/gtl/inlined_vector.h: In member function 'void tensorflow::gtl::InlinedVector<T, N>::Destroy(T*, int)':
external/org_tensorflow/tensorflow/core/lib/gtl/inlined_vector.h:396:10: error: 'is_trivially_destructible' is not a member of 'std'
external/org_tensorflow/tensorflow/core/lib/gtl/inlined_vector.h:396:42: error: expected primary-expression before '>' token
external/org_tensorflow/tensorflow/core/lib/gtl/inlined_vector.h:396:43: error: '::value' has not been declared
Target //:install failed to build
INFO: Elapsed time: 2.086s, Critical Path: 1.43s
I have a CUDA supported CentOS 7 GPU machine with TF version 1.1.0 and tried to install sonnet
When I run
./configure
I get
ERROR: /home/xbbl35h/code/sonnet/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule. ERROR: /home/xbbl35h/code/sonnet/tensorflow/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule. ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
I saw that someone had posted a change and I have the WORKSPACE file changed to
http_file(
name = "weblas_weblas_js",
url = "file:///local_path/weblas.js",
)
I suspect it is something simple
As stated in the title, running the example rnn_shakespeare.py example triggers an attribute error types has no attribute StringTypes, eg:
Traceback (most recent call last): File "shake.py", line 309, in <module> tf.app.run() File "/usr/local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "shake.py", line 305, in main reduce_learning_rate_interval=FLAGS.reduce_learning_rate_interval) File "shake.py", line 180, in train name="shake_train") File "/usr/local/lib/python3.6/site-packages/sonnet/examples/dataset_shakespeare.py", line 111, in __init__ super(TinyShakespeareDataset, self).__init__(name=name) File "/usr/local/lib/python3.6/site-packages/sonnet/python/modules/base.py", line 118, in __init__ if not isinstance(name, types.StringTypes): AttributeError: module 'types' has no attribute 'StringTypes'
This is most likely due to the fact that StringTypes was deprecated, and then later removed from python3
Continuing on #50 I am still not sure the self._enter_variable_scope
is having the correct effect on operation naming in Tensorboard.
I've written a simple module -> submodule example with and without _enter_variable_scope
and I've got different graphs in Tensorboard.
Even though the variables end up being the same:
['main_module/linear/w:0', 'main_module/linear/b:0']
['main_module/linear/w:0', 'main_module/linear/b:0']
I get these two different graphs in Tensorboard:
with snt.Linear
defined on the _build
method:
with snt.Linear
defined on the init with _enter_variable_scope
:
Hi the install on this is very hard I do not know if resample is a module... I tried finding one and installing it.
I tried anaconda
I tried the gpu version first and figured uninstall and use python 2 and try with cpu only and minimal configuration no gpu no opencl...
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import sonnet as snt
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/sonnet/init.py", line 103, in
from sonnet.python.ops.resampler import resampler
File "/usr/local/lib/python2.7/dist-packages/sonnet/python/ops/resampler.py", line 33, in
tf.resource_loader.get_path_to_datafile("_resampler.so"))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python2.7/dist-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
Ahoi!
I installed sonnet according to the readme, but I was stuck quite some time at this point:
$ ./bazel-bin/install /tmp/sonnet
I replaced /tmp/sonnet by some local relative directory path, which doesnt work, i.e. no .whl is generated. If I use ./bazel-bin/install with some absolute path everything works fine (read: breaks at another point).
I first thought that was a bazel issue, but some guys in the #bazel channel on irc convinced me otherwise.
I recommend either fixing the handling of relative paths in the ./bazel-bin/install script itself, throwing an error or at least pointing out the issue in the README.md. That way others may not be stuck for several hours, too.
Simply follow the instructions produces the following error at the "./configure" on macOS:
Please specify the location of python. [Default is /usr/local/bin/python]:
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
sed: can't read : No such file or directory
I followed the instructions, and got this error when building:
ubuntu@BorisGPUMP2 [ /tmp/sonnet ] (master)
[18:35]: bazel build --config=opt :install
zsh: correct 'build' to 'BUILD' [nyae]? n
.............
WARNING: Config values are not defined in any .rc file: opt
WARNING: /home/ubuntu/.cache/bazel/_bazel_ubuntu/73ef796d701fb86018fd94fe895372e2/external/org_tensorflow/tensorflow/workspace.bzl:72:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
INFO: Found 1 target...
ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/73ef796d701fb86018fd94fe895372e2/external/protobuf/BUILD:241:1: C++ compilation of rule '@protobuf//:js_embed' failed: Process exited with status 1 [sandboxed].
src/main/tools/linux-sandbox-pid1.cc:257: "mount(/tmp/sonnet, tmp/sonnet, NULL, MS_BIND, NULL)": No such file or directory
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/ubuntu/.cache/bazel/_bazel_ubuntu/73ef796d701fb86018fd94fe895372e2/external/org_tensorflow/tensorflow/core/BUILD:190:1 C++ compilation of rule '@protobuf//:js_embed' failed: Process exited with status 1 [sandboxed].
INFO: Elapsed time: 8.429s, Critical Path: 0.18s
[18:39]: lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
I am trying to install sonnet on Mac but I get the following error:
sonnet/sonnet/python/BUILD:131:1 C++ compilation of rule '@protobuf//:protobuf' failed: cc_wrapper.sh failed: error executing command
(exec env -
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/swarsh/torch/install/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
TMPDIR=/var/folders/q9/1zzwnrpx5f31kw21mwzdqxjh0000gn/T/
external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -MD -MF bazel-out/host/bin/external/protobuf/objs/protobuf/external/protobuf/src/google/protobuf/struct.pb.d '-frandom-seed=bazel-out/host/bin/external/protobuf/objs/protobuf/external/protobuf/src/google/protobuf/struct.pb.o' -iquote external/protobuf -iquote bazel-out/host/genfiles/external/protobuf -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -isystem external/protobuf/src -isystem bazel-out/host/genfiles/external/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/protobuf/src/google/protobuf/struct.pb.cc -o bazel-out/host/bin/external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/struct.pb.o)
external/local_config_cc/cc_wrapper.sh: line 56: -U_FORTIFY_SOURCE: command not found
It seems like when you are using self._enter_variable_scope
in the __init__
you end up with a "module"_1
scope for you main ops.
It's very annoying and confusing to look at the Tensorboard when that happens (example below).
I've written a simple two-submodule module in Sonnet. The prints I get are:
['main_module_1/submodule_a/Variable:0', 'main_module_1/submodule_b/Variable:0']
['main_module/submodule_a/Variable:0', 'main_module/submodule_b/Variable:0']
I tried looking into how to "fix" it but I need some guidance of the possible ways to do it (without tearing the whole thing apart).
I am using Ubuntu 14.04, and installed bazel with jdk1.7. The build failed with a java exception.
After I updated jdk to 1.8 version and reinstalled the corresponding bazel, the build succeeded.
Since bazel still supports jdk1.7, I wonder if you could specify the jdk requirement in installation instructions if sonnet does not.
The error is like this:
java.lang.NoSuchMethodError: java.util.Map.putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
at com.google.devtools.build.lib.actions.CompositeRunfilesSupplier.getMappings(CompositeRunfilesSupplier.java:69)
at com.google.devtools.build.lib.sandbox.SpawnHelpers.mountRunfilesFromSuppliers(SpawnHelpers.java:146)
at com.google.devtools.build.lib.sandbox.SpawnHelpers.getMounts(SpawnHelpers.java:55)
at com.google.devtools.build.lib.sandbox.SandboxStrategy.getMounts(SandboxStrategy.java:153)
at com.google.devtools.build.lib.sandbox.LinuxSandboxedStrategy.getMounts(LinuxSandboxedStrategy.java:42)
at com.google.devtools.build.lib.sandbox.LinuxSandboxedStrategy.exec(LinuxSandboxedStrategy.java:121)
at com.google.devtools.build.lib.sandbox.LinuxSandboxedStrategy.exec(LinuxSandboxedStrategy.java:90)
at com.google.devtools.build.lib.analysis.actions.SpawnAction.internalExecute(SpawnAction.java:266)
at com.google.devtools.build.lib.rules.genrule.GenRuleAction.internalExecute(GenRuleAction.java:73)
at com.google.devtools.build.lib.analysis.actions.SpawnAction.execute(SpawnAction.java:274)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeActionTask(SkyframeActionExecutor.java:778)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.prepareScheduleExecuteAndCompleteAction(SkyframeActionExecutor.java:718)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.access$800(SkyframeActionExecutor.java:102)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:608)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:570)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:380)
at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:440)
at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:196)
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:374)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:501)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
I have been unable to install Sonnet because of a compiler error. I tried to find if this was a bug with gcc and I found similar entries, however updating gcc did not work. This error happened to me using verions 5.3 and 6.2 of gcc (output of the latter below).
abermea@host:~/Projects/Sonnet/sonnet$ bazel build --config=opt :install
.
WARNING: Config values are not defined in any .rc file: opt
WARNING: /home/abermea/.cache/bazel/_bazel_abermea/ca99c09533717eb94266b31b726808fb/external/org_tensorflow/tensorflow/workspace.bzl:72:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
INFO: Found 1 target...
ERROR: /home/abermea/Projects/Sonnet/sonnet/sonnet/cc/kernels/BUILD:19:1: C++ compilation of rule '//sonnet/cc/kernels:resampler_op' failed: Process exited with status 1 [sandboxed].
sonnet/cc/kernels/resampler_op.cc: In instantiation of 'deepmind::tensorflow::sonnet::functor::ResamplerGrad2DFunctor<Eigen::ThreadPoolDevice, T>::operator()(tensorflow::OpKernelContext*, const CPUDevice&, const T*, const T*, const T*, T*, T*, int, int, int, int, int)::<lambda(int, int)>::<lambda(int, int, int, T)> [with T = double]':
sonnet/cc/kernels/resampler_op.cc:269:23: required from 'struct deepmind::tensorflow::sonnet::functor::ResamplerGrad2DFunctor<Eigen::ThreadPoolDevice, T>::operator()(tensorflow::OpKernelContext*, const CPUDevice&, const T*, const T*, const T*, T*, T*, int, int, int, int, int)::<lambda(int, int)> [with T = double]::<lambda(int, int, int, double)>'
sonnet/cc/kernels/resampler_op.cc:272:9: required from 'deepmind::tensorflow::sonnet::functor::ResamplerGrad2DFunctor<Eigen::ThreadPoolDevice, T>::operator()(tensorflow::OpKernelContext*, const CPUDevice&, const T*, const T*, const T*, T*, T*, int, int, int, int, int)::<lambda(int, int)> [with T = double]'
sonnet/cc/kernels/resampler_op.cc:317:38: required from 'struct deepmind::tensorflow::sonnet::functor::ResamplerGrad2DFunctor<Eigen::ThreadPoolDevice, T>::operator()(tensorflow::OpKernelContext*, const CPUDevice&, const T*, const T*, const T*, T*, T*, int, int, int, int, int) [with T = double; deepmind::tensorflow::sonnet::CPUDevice = Eigen::ThreadPoolDevice]::<lambda(int, int)>'
sonnet/cc/kernels/resampler_op.cc:338:5: required from 'void deepmind::tensorflow::sonnet::functor::ResamplerGrad2DFunctor<Eigen::ThreadPoolDevice, T>::operator()(tensorflow::OpKernelContext*, const CPUDevice&, const T*, const T*, const T*, T*, T*, int, int, int, int, int) [with T = double; deepmind::tensorflow::sonnet::CPUDevice = Eigen::ThreadPoolDevice]'
sonnet/cc/kernels/resampler_op.cc:407:51: required from 'void deepmind::tensorflow::sonnet::ResamplerGradOp<Device, T>::Compute(tensorflow::OpKernelContext*) [with Device = Eigen::ThreadPoolDevice; T = double]'
sonnet/cc/kernels/resampler_op.cc:443:1: required from here
sonnet/cc/kernels/resampler_op.cc:239:47: internal compiler error: in tsubst_copy, at cp/pt.c:13970
const int data_batch_stride = data_height * data_width * data_channels;
~~~~~~~~~~~~^~~~~~~~~~~~
0x60e858 tsubst_copy
../../src/gcc/cp/pt.c:13970
0x60efb1 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:17067
0x6102b8 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16252
0x6102b8 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16252
0x60aa58 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15876
0x60bab5 tsubst_init
../../src/gcc/cp/pt.c:13916
0x60e8e6 tsubst_copy
../../src/gcc/cp/pt.c:14109
0x60efb1 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:17067
0x6102d6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16253
0x6102b8 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16252
0x6102b8 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16252
0x60f2bf tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16285
0x60fa64 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../src/gcc/cp/pt.c:16390
0x60aa58 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15876
0x609686 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15192
0x60a903 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15364
0x609980 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15344
0x60a8bc tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15178
0x60a903 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15364
0x60a8bc tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../src/gcc/cp/pt.c:15178
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 34.787s, Critical Path: 11.86s
==========================================
abermea@host:~/Projects/Sonnet/sonnet$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.2.0-3ubuntu11~16.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20160901 (Ubuntu 6.2.0-3ubuntu11~16.04)
Machine : Mac Pro
Tensorflow 1.0.1 installed with method suggested for Anaconda ( in TensorFlow docs ).
Build and install Sonnet you get the following error even if correct TF is present:
pip install /tmp/sonnet/*.whl
Processing /tmp/sonnet/sonnet-1.0-py3-none-any.whl
Collecting nose-parameterized>=0.6.0 (from sonnet==1.0)
Downloading nose_parameterized-0.6.0-py2.py3-none-any.whl
Collecting tensorflow>=1.0.1 (from sonnet==1.0)
Could not find a version that satisfies the requirement tensorflow>=1.0.1 (from sonnet==1.0) (from versions: 0.12.1, 1.0.0, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2)
No matching distribution found for tensorflow>=1.0.1 (from sonnet==1.0)
work-around:
pip install /tmp/sonnet/*.whl --no-dependencies
I used to=== pip install dm-sonnet-gpu
It can be installed, but testing a DNC program is wrong
It is known Sonnet module fails to merit the simple device placement directive, which was addressed as in issue #61 , there @kosklain offered a good solution. However there is a tiny problem in practice. Just look at the demonstrating code below:
import tensorflow as tf
import sonnet as snt
class RCNNOutput(snt.AbstractModule):
def __init__(self, out_size, name = "rcnn_output"):
super(RCNNOutput, self).__init__(name = name)
with self._enter_variable_scope():
bf = snt.BatchFlatten(name = "bf")
fc0 = snt.Linear(output_size = 256, name = "fc0")
fc1 = snt.Linear(output_size = out_size, name = "fc1")
self._seq = snt.Sequential([bf, fc0, tf.nn.relu, fc1], name = "seq")
def _build(self, inputs):
return self._seq(inputs)
def test():
import numpy as np
from tensorflow.core.framework import node_def_pb2
num_gpus = 2
def get_device_setter(gpu_id):
def device_setter(op):
_variable_ops = ["Variable", "VariableV2", "VarHandleOp"]
node_def = op if isinstance(op, node_def_pb2.NodeDef) else op.node_def
return '/cpu:0' if node_def.op in _variable_ops else '/gpu:%d' % gpu_id
return device_setter
with tf.device(get_device_setter(0)):
rcnn_output = RCNNOutput(4)
with tf.device('/cpu:0'):
t = tf.constant(np.ones([8, 32, 32, 3]), np.float32)
ts = tf.split(t, num_gpus)
total_outputs = []
for i in range(num_gpus):
with tf.device(get_device_setter(i)):
output = rcnn_output(ts[i])
total_outputs.append(output)
total_outputs = tf.add_n(total_outputs)
writer = tf.summary.FileWriter("rcnn_output_output", tf.get_default_graph())
config = tf.ConfigProto(log_device_placement = True)
with tf.Session(config = config) as sess:
sess.run([tf.global_variables_initializer(), tf.local_variables_initializer()])
v = sess.run(total_outputs)
print(v)
writer.close()
if __name__ == "__main__":
test()
The first concern is the following code snippet in the above code example:
with tf.device(get_device_setter(0)):
rcnn_output = RCNNOutput(4)
t = tf.constant(np.ones([8, 32, 32, 3]), np.float32)
Here 0 is just for some placeholder purpose, since the intention is to have the model parameters placed on CPU, in order to be shared across multiple GPUs. Although I could define get_device_setter in some prototype like get_device_setter(gpu_id = 0), probably someone still makes the criticism that here the sole intention is to construct everything on CPU, why a GPU ID involves?
The criticism is tended to be a little stronger when the code snippet below is added together:
with tf.device('/cpu:0'):
t = tf.constant(np.ones([8, 32, 32, 3]), np.float32)
ts = tf.split(t, num_gpus)
The intention here is we have all inputs prepared on CPU. So people will say, why you mix directives together, why you can not place them under one directive? Simply answering because Sonnet doesn't support the simple device placement directive, so it is can not be done in a harmonic way, is probably not a good answer to ease every skepticism.
So I just wonder could it be done a little nicer than the above approach, namely use a more obvious directive for a neatly placement control both for inputs preparation and model construction?
Many thanks.
Is windows support planned?
I didn't manage to run the ./configure script of tensorflow. However, by moving the BUILD file to a new name, i could install sonnet by doing a simple
python setup.py install
I did not encounter bugs other than the complicated setup.
Hi.
More than an issue, my question is if there is some easy way to run sonnet on Google Cloud Machine Learning, i have a code i would like to test on the cloud but is written using Sonnet and i get an import error trying to run it.
Maybe using the setup.py but i'm new building packages and nothing comes to my mind.
If this isn't the place for this question, I apologize.
Any help on this matter is really appreciated.
Thanks
Recently I try to write some customized python modules based on Sonnet for processing EEG data, but due to the magnitude of EEG data, I want to utilize multiple GPUs for training, then problem emerges that I cannot figure it out.
According to my understanding, the paradigm for synchronous multi-GPU training requires the trainable variables resides on CPU, while operations are performed on GPU, and tensors are transported in between as required.
The problem is in my view such an arrangement is difficult for the Sonnet module. For example, considering the small module as follows:
import tensorflow as tf
import sonnet as snt
class RCNNOutput(snt.AbstractModule):
def __init__(self, out_size, device_name, name = "rcnn_output"):
super(RCNNOutput, self).__init__(name = name)
with self._enter_variable_scope():
with tf.device(device_name):
bf = snt.BatchFlatten(name = "bf")
fc0 = snt.Linear(output_size = 256, name = "fc0")
fc1 = snt.Linear(output_size = out_size, name = "fc1")
self._seq = snt.Sequential([bf, fc0, tf.nn.relu, fc1], name = "seq")
def _build(self, inputs):
return self._seq(inputs)
def test():
import numpy as np
rcnn_output = RCNNOutput(4, '/cpu:0')
with tf.device('/cpu:0'):
t = tf.constant(np.ones([8, 32, 32, 3]), np.float32)
with tf.device('/gpu:0'):
outputs = rcnn_output(t)
writer = tf.summary.FileWriter("rcnn_output_output", tf.get_default_graph())
config = tf.ConfigProto(log_device_placement = True)
with tf.Session(config = config) as sess:
sess.run([tf.global_variables_initializer(), tf.local_variables_initializer()])
v = sess.run(outputs)
print(v)
writer.close()
if __name__ == "__main__":
test()
whatever I tried, I cannot get the weights put on CPU, it always put on GPU, even I explicitly give the placement directive:
2017-08-31 21:51:11.250360: I tensorflow/core/common_runtime/simple_placer.cc:847] rcnn_output/fc1/b: (VariableV2)/job:localhost/replica:0/task:0/gpu:0
rcnn_output/fc1/b/read: (Identity): /job:localhost/replica:0/task:0/gpu:0
2017-08-31 21:51:11.250366: I tensorflow/core/common_runtime/simple_placer.cc:847] rcnn_output/fc1/b/read: (Identity)/job:localhost/replica:0/task:0/gpu:0
rcnn_output/fc1/b/Assign: (Assign): /job:localhost/replica:0/task:0/gpu:0
2017-08-31 21:51:11.250371: I tensorflow/core/common_runtime/simple_placer.cc:847] rcnn_output/fc1/b/Assign: (Assign)/job:localhost/replica:0/task:0/gpu:0
rcnn_output/fc1/w: (VariableV2): /job:localhost/replica:0/task:0/gpu:0
2017-08-31 21:51:11.250377: I tensorflow/core/common_runtime/simple_placer.cc:847] rcnn_output/fc1/w: (VariableV2)/job:localhost/replica:0/task:0/gpu:0
rcnn_output/fc1/w/read: (Identity): /job:localhost/replica:0/task:0/gpu:0
Only the constant tensor got put on CPU:
Const: (Const): /job:localhost/replica:0/task:0/cpu:0
2017-08-31 21:51:11.250690: I tensorflow/core/common_runtime/simple_placer.cc:847] Const: (Const)/job:localhost/replica:0/task:0/cpu:0
I sincerely appreciate if any engineer at Deepmind could look into the problem and many thanks for giving some suggestions.
I assume it only requires the code like:
convlstm = snt.ConvLSTM() to call, but fails and prompting no such module...
Using Sonnet is practice right now is really much harder than it should be:
Because no pre-built binaries are available and Sonnet isn't published on PyPI, every user has to go through the difficult process of installing bazel and building Sonnet themselves, as exemplified by the many issues filed by people having problems with the build process.
I have had to jump through many hoops to find a way to use Sonnet in a project which I train on Google Cloud ML Engine (the solution was to build Sonnet inside a Debian Docker container on my Mac and then to upload the resulting wheel to Google Cloud ML). This would have been much easier if binary builds were available for download.
Secondly there is no versioning yet, so it's extremely difficult to ensure different machines or environments actually run the same Sonnet version or to tell which commits break compatibility with previous versions.
I understand that Sonnet is an early piece of software, but given how widely you publicized the open-source release, could you comment on your plans to implement some versioning and packaging to make it more practical to use?
In the MyMLP example, it says:
new instances of snt.Linear are generated each time _build() is called, and you may think this will create different, unshared variables. This is not the case - only 4 variables (2 for each Linear) will be created, no matter how many times the MLP instance is connected into the graph. ****
So... what if I don't want the variables to be shared? For example, suppose I wanted to have a deeper net by stacking 4 MyMLP instances. I want each of them to have their own weights, not to share weights. Is this just not possible?
When I used pondering_rnn (Adaptive Computation Time) to wrap an LSTM cell and tried to use L2 regularization, there were some errors,
initializer = {'b_gates':tf.truncated_normal_initializer(stddev=1.0),
'w_gates':tf.truncated_normal_initializer(stddev=1.0)}
regularizer = {'b_gates':tf.contrib.layers.l2_regularizer(0.1),
'w_gates':tf.contrib.layers.l2_regularizer(0.1)}
act_core = LSTM(hidden_size, regularizers=regularizer, initializers=initializer)
self._controller = ACTCore(core=act_core,
output_size=self._out_width,
threshold=threshold,
get_state_for_halting=self._get_hidden_state)
self._initial_state = self._controller.initial_state(self._batch_size)
regularization_loss = tf.reduce_sum(tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES))
The error is as follows:
The node 'Sum' has inputs from different frames. The input 'Sum/input' is in frame 'rnn/while/act_core/while/rnn/while/act_core/while/'. The input 'range' is in frame ''.
Seems to be tf.while_loop the problem, but I do not know how to solve this problem
Young
image with all of the things installed or something make this easy to use?
I see there is a virtual environment are there images of that or something that could make a CPU version of this available and then a user could put the code they write to Amazon ec2 cloud running GPUs?
This is probably not a defect of sonnet, however, I would like to share it to see on earth it is a potential bug or not.
Currently I implemented a multi-layer RNN model. The cell is intended of some customized one, the code is as follows:
import tensorflow as tf
import sonnet as snt
class Cell(snt.RNNCore):
def __init__(self, hidden_size, name = "cell"):
super(Cell, self).__init__(name = name)
self._hidden_size = hidden_size
with self._enter_variable_scope():
self._update_lin = snt.Linear(output_size = hidden_size)
self._reset_lin = snt.Linear(output_size = hidden_size)
self._cell_seq = snt.Sequential([snt.Linear(output_size = hidden_size), tf.tanh])
def _build(self, inputs, state):
i_s = tf.concat([inputs, state], -1)
reset = self._reset_lin(i_s)
update = self._update_lin(i_s)
cell = self._cell_seq(tf.concat([inputs, reset * state], -1))
output = update * state + (1 - update) * cell
return output, output
@property
def state_size(self):
return tf.TensorShape([self._hidden_size])
@property
def output_size(self):
return tf.TensorShape([self._hidden_size])
def initial_state(self, batch_size):
return tf.zeros([batch_size, self._hidden_size])
However, when I try to use the code to build a multi-layer RNN, the following way is work:
import tensorflow as tf
import sonnet as snt
from cell import Cell
class Model(snt.AbstractModule):
def __init__(self, batch_size, num_layers = 2, hidden_size = 8, name = "model"):
super(Model, self).__init__(name = name)
self._batch_size = batch_size
self._num_layers = num_layers
self._hidden_size = hidden_size
with self._enter_variable_scope():
self._cell1 = Cell(8)
self._cell2 = Cell(8)
# self._cells = tf.nn.rnn_cell.MultiRNNCell([Cell(8)] * num_layers, state_is_tuple = True)
self._seq = snt.Sequential([snt.Linear(output_size = 1), tf.tanh])
def _build(self, inputs):
init_state = self._cell1.initial_state(self._batch_size)
outputs, _ = tf.nn.dynamic_rnn(self._cell1, inputs, initial_state = init_state)
init_state = self._cell2.initial_state(self._batch_size)
outputs, _ = tf.nn.dynamic_rnn(self._cell2, outputs, initial_state = init_state)
'''
init_state = self._cells.zero_state(self._batch_size, tf.float32)
outputs, states = tf.nn.dynamic_rnn(self._cells, inputs, initial_state = init_state)
'''
outputs = tf.unstack(outputs, axis = 1)
outputs = self._seq(outputs[-1])
return outputs
But the way below is not, which is believed equivalent to the above approach:
import tensorflow as tf
import sonnet as snt
from cell import Cell
class Model(snt.AbstractModule):
def __init__(self, batch_size, num_layers = 2, hidden_size = 8, name = "model"):
super(Model, self).__init__(name = name)
self._batch_size = batch_size
self._num_layers = num_layers
self._hidden_size = hidden_size
with self._enter_variable_scope():
# self._cell1 = Cell(8)
# self._cell2 = Cell(8)
self._cells = tf.nn.rnn_cell.MultiRNNCell([Cell(8)] * num_layers, state_is_tuple = True)
self._seq = snt.Sequential([snt.Linear(output_size = 1), tf.tanh])
def _build(self, inputs):
'''
init_state = self._cell1.initial_state(self._batch_size)
outputs, _ = tf.nn.dynamic_rnn(self._cell1, inputs, initial_state = init_state)
init_state = self._cell2.initial_state(self._batch_size)
outputs, _ = tf.nn.dynamic_rnn(self._cell2, outputs, initial_state = init_state)
'''
init_state = self._cells.zero_state(self._batch_size, tf.float32)
outputs, states = tf.nn.dynamic_rnn(self._cells, inputs, initial_state = init_state)
outputs = tf.unstack(outputs, axis = 1)
outputs = self._seq(outputs[-1])
return outputs
You can test above code using the following code snippet:
def test():
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
t = tf.constant([[[1], [2], [3], [4], [5], [6]],
[[2], [3], [4], [5], [6], [7]],
[[3], [4], [5], [6], [7], [8]],
[[4], [5], [6], [7], [8], [9]]], tf.float32)
model = Model(4)
r = model(t)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
v = sess.run(r)
print(v)
if __name__ == "__main__":
test()
I am appreciating any engineer in Deepmind can take time to look into it, many thanks.
Excuse me, what time can support Python3. X?Have this plan?
I noticed sonnet has provided a module called LayerNorm, which is based on the article https://arxiv.org/abs/1607.06450.
However, when I look at the corresponding implementation of TensowFlow, it provides a class called LayerNormBasicLSTMCell (TensorFlow does provides a standalone version of layer normalization tf.contrib.layers.layer_norm).
According to my understanding, and when I check the code in https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/contrib/rnn/python/ops/rnn_cell.py:
i, j, f, o = array_ops.split(value=concat, num_or_size_splits=4, axis=1)
if self._layer_norm:
i = self._norm(i, "input")
j = self._norm(j, "transform")
f = self._norm(f, "forget")
o = self._norm(o, "output")
What I mean here is the layer normalization is done INSIDE the cell, before activation. However, when sonnet provides the solo LayerNorm module in sonnet, in which way it is intended to be used? Like the following way:
import numpy as np
import tensorflow as tf
import sonnet as snt
class Model(snt.AbstractModule):
def __init__(self, name = "model"):
super(Model, self).__init__(name = name)
hidden_size_array = [8, 8, 8]
with self._enter_variable_scope():
self._layer1 = snt.LSTM(hidden_size_array[0], name = 'layer1_lstm')
self._norm1 = snt.BatchApply(snt.LayerNorm(), name = 'layer1_norm')
self._layer2 = snt.LSTM(hidden_size_array[1], name = 'layer2_lstm')
self._norm2 = snt.BatchApply(snt.LayerNorm(), name = 'layer2_norm')
self._layer3 = snt.LSTM(hidden_size_array[2], name = 'layer3_lstm')
self._norm3 = snt.BatchApply(snt.LayerNorm(), name = 'layer3_norm')
def _build(self, inputs):
batch_size = inputs.get_shape()[0]
initial_state = self._layer1.initial_state(batch_size)
output_sequence, final_state = \
tf.nn.dynamic_rnn(self._layer1, inputs, initial_state = initial_state, time_major = False)
output_sequence = self._norm1(output_sequence)
initial_state = self._layer2.initial_state(batch_size)
output_sequence, final_state = \
tf.nn.dynamic_rnn(self._layer2, output_sequence, initial_state = initial_state, time_major = False)
output_sequence = self._norm2(output_sequence)
initial_state = self._layer3.initial_state(batch_size)
output_sequence, final_state = \
tf.nn.dynamic_rnn(self._layer3, output_sequence, initial_state = initial_state, time_major = False)
output_sequence = self._norm3(output_sequence)
return output_sequence
def test():
t = tf.constant(np.ones((4, 6, 8)), tf.float32)
model = Model()
outputs = model(t)
with tf.Session() as sess:
sess.run([tf.global_variables_initializer()])
v = sess.run(outputs)
print(v)
if __name__ == "__main__":
test()
Nevertheless in this way it can work, however, seems layer normalization is done outside the activation of LSTM cell.
So I just wonder the dear engineers at DeepMind could give a doc a little detailed with regarding to the usage of LayerNorm module or not? (Or even probably my understanding of layer normalization is wrong). But I would like to hear the opinion of engineers there, so by clarification we can have sonnet easier to use.
Thanks a lot.
posted on Issue #23 but since it's closed, I am guessing that it is not being review.
I used pip to upgrade TensorFlow to 1.1 but having an error when trying to configure the headers to bazel build:
[cmwatson@xx tensorflow]$ ./configure
Please specify the location of python. [Default is /usr/bin/python]:
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Do you wish to use jemalloc as the malloc implementation? [Y/n]
jemalloc enabled
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N]
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N]
No XLA support will be enabled for TensorFlow
Found possible Python library paths:
/usr/lib/python2.7/site-packages
/usr/lib64/python2.7/site-packages
Please input the desired Python library path to use. Default is [/usr/lib/python2.7/site-packages]
Using python library path: /usr/lib/python2.7/site-packages
Do you wish to build TensorFlow with OpenCL support? [y/N]
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N]
No CUDA support will be enabled for TensorFlow
Configuration finished
Warning: ignoring http_proxy in environment.
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
Warning: ignoring http_proxy in environment.
...........
ERROR: /home/cmwatson/sonnet/tensorflow/tensorflow/tensorboard/bower/BUILD:5:1: no such package '@weblas_weblas_js//file': Error downloading [https://raw.githubusercontent.com/waylonflinn/weblas/v0.9.0/dist/weblas.js] to /home/cmwatson/.cache/bazel/_bazel_cmwatson/69b7f2b22f6b880ca0a532b8cb646acd/external/weblas_weblas_js/weblas.js: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and referenced by '//tensorflow/tensorboard/bower:bower'.
ERROR: /home/cmwatson/.cache/bazel/_bazel_cmwatson/69b7f2b22f6b880ca0a532b8cb646acd/external/com_google_dagger/BUILD:13:1: no such package '@com_google_dagger_compiler//': java.io.IOException: Error downloading [http://domain-registry-maven.storage.googleapis.com/repo1.maven.org/maven2/com/google/dagger/dagger-compiler/2.8/dagger-compiler-2.8.jar, http://maven.ibiblio.org/maven2/com/google/dagger/dagger-compiler/2.8/dagger-compiler-2.8.jar, http://repo1.maven.org/maven2/com/google/dagger/dagger-compiler/2.8/dagger-compiler-2.8.jar] to /home/cmwatson/.cache/bazel/_bazel_cmwatson/69b7f2b22f6b880ca0a532b8cb646acd/external/com_google_dagger_compiler/dagger-compiler-2.8.jar: Tried to reconnect at offset 8,481,153 but server didn't support it and referenced by '@com_google_dagger//:com_google_dagger'.
ERROR: Evaluation of query "deps(((//tensorflow/... - //tensorflow/contrib/nccl/...) - //tensorflow/examples/android/...))" failed: errors were encountered while computing transitive closure.
I have never used bazel, so hopefully this is a trivial fix, but I'm inexperienced.
Hi,
I am trying to install sonnet on top of tensorflow rc1.2 and get the following error:
/root/.cache/bazel/_bazel_root/76ab1f57e69b3872947e0ef757e4f315/external/org_tensorflow/tensorflow/workspace.bzl:7:6: file '@io_bazel_rules_closure//closure:defs.bzl' does not contain symbol 'web_library_external'.
I'm doing it in a docker image with Ubuntu 16:04 and Python 3.5
here is a link to a docker file replicating the issue
Using a similar DockerFile which uses tensorflow r1.1 in this link everything works fine.
I get:
sudo bazel build --config=opt :install
Password:
Extracting Bazel installation...
.........
WARNING: Config values are not defined in any .rc file: opt
WARNING: /private/var/tmp/_bazel_root/81097c8f44aae43fe60488543d11a0e1/external/org_tensorflow/tensorflow/workspace.bzl:72:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
WARNING: /Users/CBrauer/sonnet/sonnet/python/BUILD:119:1: in srcs attribute of cc_binary rule //sonnet/python:ops/_resampler.so: please do not import '//sonnet/cc:ops/resampler.cc' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /Users/CBrauer/sonnet/sonnet/tensorflow.bzl:108:25.
WARNING: /Users/CBrauer/sonnet/sonnet/python/BUILD:119:1: in srcs attribute of cc_binary rule //sonnet/python:ops/_resampler.so: please do not import '//sonnet/cc/kernels:resampler_op.cc' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /Users/CBrauer/sonnet/sonnet/tensorflow.bzl:108:25.
WARNING: /Users/CBrauer/sonnet/sonnet/python/BUILD:119:1: in srcs attribute of cc_binary rule //sonnet/python:ops/_resampler.so: please do not import '//sonnet/cc/kernels:resampler_op.h' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'tf_custom_op_library', the error might have been caused by the macro implementation in /Users/CBrauer/sonnet/sonnet/tensorflow.bzl:108:25.
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_root/81097c8f44aae43fe60488543d11a0e1/external/gif_archive/BUILD.bazel:8:1: C++ compilation of rule '@gif_archive//:gif' failed: Process exited with status 1 [sandboxed].
couldn't understand kern.osversion `16.5.0'
cc1: error: unrecognized command line option "-Wthread-safety"
cc1: error: unrecognized command line option "-Wself-assign"
cc1: warning: unrecognized command line option "-Wno-free-nonheap-object"
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 12.066s, Critical Path: 0.19s
Please help.
Charles
I am trying to get sonnet installed I like the idea of some of the configure features but i would like a little more documentation on getting the full featured configured sonnet.
OpenCL and if I can get the ANN in a FPGA would be a great tutorial.
Video tutorials could help cover details.
There are free screencasting linux and windows software.
After configuring sonnet, I found out tensorflow 1.01 is installed along with my original tensorflow-gpu 1.01. However only tensorflow 1.01 is recognized as the imported one... Plz share a instruction
It seems --config=opt
doesn't make sense.
While building docker images, noticed that sonnet breaks with the new version of TF 1.2.0.
root@a28ad161d26d:/# python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sonnet as snt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/lib/python3.5/site-packages/sonnet/__init__.py", line 109, in <module>
from sonnet.python.ops.resampler import resampler
File "/opt/conda/lib/python3.5/site-packages/sonnet/python/ops/resampler.py", line 33, in <module>
tf.resource_loader.get_path_to_datafile("_resampler.so"))
File "/opt/conda/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /opt/conda/lib/python3.5/site-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow15shape_inference16InferenceContext15WithRankAtLeastENS0_11ShapeHandleEiPS2_
TensorFlow was installed via pip, sonnet was compiled and installed from sources. Perhaps, updating the TF submodule with headers should solve this.
Not quite sure why I'm getting this error. Does it have something to do with reuse_variables still being experimental?
Thanks
Hi, I realized that the variable of convLSTM includes two biases if use_bias
is set to true. And I think it is because here the convolution is performed separately on input and state. But effectively only one set of bias is necessary. Perhaps adding bias at the end instead of within the convolution as done in the tensorflow contrib version (https://github.com/tensorflow/tensorflow/pull/8891/files) would be better.
I am now trying to build a Lstm encoder decoder framework using sonnet and tensorflow. I understand sonnet have the lstm module involved. I was trying to build encoder decoder with tf.contrib.seq2seq.decoder. However, I am not sure if this one builds encoder implicitly, and the decoder_inputs are encoder_input? Since in my case, I do not have any input for decoder but the output from previous step...
Is there any warpper in Sonnet for this kind of issue? Can you suggest some proper way to do this?
Hi, I'm trying to simply install sonnet, but it is not working. I used instructions on the first page and also did sudo python setup.py build && python setup.py install
it seems to be installed fine but I get the following error, can someone tell me what is going on?:
`
import sonnet as snt
import tensorflow as tf
snt.resampler(tf.constant([0.]), tf.constant([0.]))
Traceback (most recent call last):
File "", line 1, in
File "sonnet/python/ops/resampler.py", line 65, in resampler
raise ImportError("_gen_resampler could not be imported.")
ImportError: _gen_resampler could not be imported.
`
import sonnet as snt
train_data = get_training_data()
test_data = get_test_data()
# Construct the module, providing any configuration necessary.
linear_regression_module = snt.Linear(output_size=FLAGS.output_size)
# Connect the module to some inputs, any number of times.
train_predictions = linear_regression_module(train_data)
test_predictions = linear_regression_module(test_data)
get_training_data() doesn't work and nor does the get_test_data() functions respectively.
Also, there is no documentation on how to run the examples with the Shakespeare dataset in /sonnet/sonnet/examples.
Finally, I had to comment the following lines in the source code of Sonnet in lines 42-44 of nest.py inside /sonnet/sonnet/python/ops/:
#map_up_to = nest.map_structure_up_to
#assert_shallow_structure = nest.assert_shallow_structure
#flatten_up_to = nest.flatten_up_to
for the code to run.
Could you please let me know if the current version of Sonnet is compatible with Tensorflow 1.3.0?
$ sudo -H pip3 install dm-sonnet-gpu
Collecting dm-sonnet-gpu
Could not find a version that satisfies the requirement dm-sonnet-gpu (from versions: )
No matching distribution found for dm-sonnet-gpu
Fedora 24, tensorflow 1.0.1, bazel 0.4.5
Installing sonnet seems to have been successful (Requirement already satisfied: sonnet==1.0.....), including installing jdk8, bazel, sonnet, and the ./configure for tensorflow. But when I try to import sonnet, I get the error below. Any suggestions?
import sonnet as snt
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/sonnet/init.py", line 102, in
from sonnet.python.ops.resampler import resampler
File "/usr/lib/python2.7/site-packages/sonnet/python/ops/resampler.py", line 33, in
tf.resource_loader.get_path_to_datafile("_resampler.so"))
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/lib/python2.7/site-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
However, works if I switch to the sonnet directory, then import, but then testing it I get an ImportError:
import sonnet as snt
import tensorflow as tf
snt.resampler(tf.constant([0.]), tf.constant([0.]))
Traceback (most recent call last):
File "", line 1, in
File "sonnet/python/ops/resampler.py", line 65, in resampler
raise ImportError("_gen_resampler could not be imported.")
ImportError: _gen_resampler could not be imported.
I did uninstall sonnet before installing the whl file.
I have follow error when try to install Sonnet:
pip install dm-sonnet
Collecting dm-sonnet
Could not find a version that satisfies the requirement dm-sonnet (from versions: )
No matching distribution found for dm-sonnet
I use Windows10 and Tensorflow with GPU version 1.2.1
My config:
Anaconda 2 + tensorflow (no gpu) / Ubuntu 16.04
I assemble sonnet as specified, except I build with following flag:
bazel build --config=opt :install --copt="-D_GLIBCXX_USE_CXX11_ABI=0"
I use this flag. because otherwise I get following error:
NotFoundError: /home/kovalenko/anaconda2/lib/python2.7/site-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
Following code causes error Segmentation fault:
import numpy as np
import sonnet as snt
import tensorflow as tf
image = np.ones((1, 100, 100, 3))
image[0, 50, :, :] = 0
image[0, :, 50, :] = 0
shift = np.ones((100, 100, 2))
shift[:, :, 1] = 0
shift = np.expand_dims(shift, 0)
res = snt.resampler(tf.Variable(initial_value=image), tf.Variable(initial_value=shift))
init_op = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init_op)
# following line triggers error
x = res.eval(session=sess)
faced this error while executing the example code
import sonnet as snt
import tensorflow as tf
snt.resampler(tf.constant([0.]), tf.constant([0.]))
recompiling the tensorflow to 1.1.0-rc2 and replacing the downloaded sonnet/tensorflow with this one solved the problem :)
after using the virtual install
got cpu install to work with different build command in forum.
bazel build --config=opt --copt="-D_GLIBCXX_USE_CXX11_ABI=0" :install
worked
#25
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.