Comments (5)
This, together with #6, made the build succeed, but after installing the wheel file, it seems like it can't find the native library:
[17:41]: python
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import sonnet as snt
>>> import tensorflow as tf
>>> snt.resampler(tf.constant([0.]), tf.constant([0.]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/anaconda3/envs/p27-tf1/lib/python2.7/site-packages/sonnet/python/ops/resampler.py", line 62, in resampler
raise ImportError("_gen_resampler could not be imported.")
ImportError: _gen_resampler could not be imported.
The wheel file also doesn't contain a native library:
[17:44]: unzip -l ./sonnet-install/sonnet-1.0-py2-none-any.whl | less
Archive: ./sonnet-install/sonnet-1.0-py2-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
4817 2017-04-13 17:41 sonnet/__init__.py
8064 2017-04-13 17:41 sonnet/examples/dataset_shakespeare.py
809 2017-04-13 17:41 sonnet/examples/__init__.py
11702 2017-04-13 17:41 sonnet/examples/rnn_shakespeare.py
3751 2017-04-13 17:41 sonnet/examples/module_with_build_args.py
892315 2017-04-13 17:41 sonnet/examples/data/ts.train.txt
111539 2017-04-13 17:41 sonnet/examples/data/ts.valid.txt
111540 2017-04-13 17:41 sonnet/examples/data/ts.test.txt
844 2017-04-13 17:41 sonnet/python/__init__.py
5452 2017-04-13 17:41 sonnet/python/modules/experimental.py
15044 2017-04-13 17:41 sonnet/python/modules/base.py
7712 2017-04-13 17:41 sonnet/python/modules/pondering_rnn.py
13392 2017-04-13 17:41 sonnet/python/modules/rnn_core.py
20102 2017-04-13 17:41 sonnet/python/modules/batch_norm.py
7109 2017-04-13 17:41 sonnet/python/modules/embed.py
12396 2017-04-13 17:41 sonnet/python/modules/util.py
829 2017-04-13 17:41 sonnet/python/modules/__init__.py
7812 2017-04-13 17:41 sonnet/python/modules/block_matrix.py
7402 2017-04-13 17:41 sonnet/python/modules/attention.py
2053 2017-04-13 17:41 sonnet/python/modules/clip_gradient.py
105355 2017-04-13 17:41 sonnet/python/modules/conv.py
2044 2017-04-13 17:41 sonnet/python/modules/scale_gradient.py
34392 2017-04-13 17:41 sonnet/python/modules/gated_rnn.py
19266 2017-04-13 17:41 sonnet/python/modules/basic_rnn.py
23212 2017-04-13 17:41 sonnet/python/modules/spatial_transformer.py
3510 2017-04-13 17:41 sonnet/python/modules/sequential.py
43211 2017-04-13 17:41 sonnet/python/modules/basic.py
21282 2017-04-13 17:41 sonnet/python/modules/nets/convnet.py
10619 2017-04-13 17:41 sonnet/python/modules/nets/alexnet.py
1301 2017-04-13 17:41 sonnet/python/modules/nets/__init__.py
8110 2017-04-13 17:41 sonnet/python/modules/nets/mlp.py
13456 2017-04-13 17:41 sonnet/python/modules/nets/dilation.py
264952 2017-04-13 17:41 sonnet/python/ops/_resampler.so
10734 2017-04-13 17:41 sonnet/python/ops/nest.py
833 2017-04-13 17:41 sonnet/python/ops/__init__.py
3377 2017-04-13 17:41 sonnet/python/ops/initializers.py
2860 2017-04-13 17:41 sonnet/python/ops/resampler.py
10 2017-04-13 17:41 sonnet-1.0.dist-info/DESCRIPTION.rst
1134 2017-04-13 17:41 sonnet-1.0.dist-info/metadata.json
7 2017-04-13 17:41 sonnet-1.0.dist-info/top_level.txt
92 2017-04-13 17:41 sonnet-1.0.dist-info/WHEEL
888 2017-04-13 17:41 sonnet-1.0.dist-info/METADATA
3867 2017-04-13 17:41 sonnet-1.0.dist-info/RECORD
--------- -------
1819196 43 files
from sonnet.
It looks like bazel has a problem with sandboxing on your machine.
Can you tru re-running the command with
--genrule_strategy=standalone --spawn_strategy=standalone
added to the command line?
from sonnet.
I got the same error as @schani for both Python 2.7 and Python 3.6
There is a warning during compiling
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/??/sonnet/sonnet/tensorflow.bzl:108:25.
from sonnet.
While I got the same error as reported, resolved with moving out from build directory.
$ git clone https://github.com/deepmind/sonnet.git
$ cd sonnet/tensorflow
$ ./configure
$ cd ../
$ mkdir /tmp/sonnet
$ bazel build --config=opt :install
$ ./bazel-bin/install /tmp/sonnet
$ pip install /tmp/sonnet/*.whl
$ python
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.
$ cd # out from sonnet source directory.
$ python
import sonnet as snt
import tensorflow as tf
snt.resampler(tf.constant([0.]), tf.constant([0.]))
<tf.Tensor 'resampler/Resampler:0' shape=(1,) dtype=float32>
from sonnet.
Duplicate of #25 . Also, as pointed out, please move out of the sonnet to import it, as you might be importing only the python dependencies (a fix for this use case is coming in the following days).
from sonnet.
Related Issues (20)
- how to remove model from gpu memory? HOT 1
- Understanding how to use mixed precision training HOT 2
- Conv2D initialize error in tf function
- Typo HOT 1
- this portion of attention code looks incorrect
- Cannot install sonnet on mac m1 HOT 5
- Decaying learning rate HOT 1
- Can you explain the logic of updated_ema_cluster_size in VectorQuantizerEMA?
- Convert a Sonnet model to a Keras model HOT 1
- (Maybe) in-consistency between VQ-VAE paper and its implementation. HOT 2
- Regarding LearningRateSchedule for ADAM optimizer HOT 2
- Learning rate and optimizer used for the VQ-VAE-2 paper HOT 2
- I have a question about the perplexity term (in the VQ-VAE). HOT 2
- Issues using Sonnet HOT 3
- How to save the checkpoint for self-defined model?
- TensorArray Not Used on line 71 of sgd_test.py HOT 2
- Is there a stereotypical way to visualize the network strucuture when using Sonnet? HOT 1
- sonnet abstract module in tensorflow2 HOT 10
- Laplace smoothing for EMA codebook update
- Basic import fails on Colab: cannot import name 'context' from 'tensorflow.python' HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonnet.