Questions tagged [sonnet]

Sonnet is a library built on top of TensorFlow designed to provide simple, composable abstractions for machine learning research.

9 questions
6
votes
1 answer

sonnet import fails on: 'from graphs import Sonnet'

Trying to run some github code which imports 'sonnet' which seems to import other packages from 'graphs'. I get: ----> 9 import sonnet as snt ~\Anaconda3\lib\site-packages\sonnet\__init__.py in () 1 __version__ = '0.1.6' ----> 2 from…
Ganitph
  • 113
  • 1
  • 6
3
votes
0 answers

Unable to load tensorflow model in Java that was originally created in python (file not found exception)

I train a neural network in python 3.7 using tensorflow in version 1.14 and sonnet in version 1.34. After training, I want to export my neural network in order to use it in Java for predictions. Unfortunately, it always displays an error while…
maxx2803
  • 33
  • 3
1
vote
1 answer

ImportError: cannot import name 'Sonnet' from 'graphs'

The code I am trying to run is import graph_nets as gn and the compiler returns ImportError: cannot import name 'Sonnet' from 'graphs' which traces back to a line in the sonnet package that says from graphs import Sonnet, D3Graph, MatplotGraph (I…
playerJX1
  • 209
  • 1
  • 11
1
vote
1 answer

LSTM timesteps in Sonnet

I'm currently trying to learn Sonnet. My network (incomplete, the question is based on this): class Model(snt.AbstractModule): def __init__(self, name="LSTMNetwork"): super(Model, self).__init__(name=name) with…
Susmit Agrawal
  • 3,649
  • 2
  • 13
  • 29
1
vote
1 answer

tf.constant and tf.placeholder behave differently

I want to wrap the tf.metrics around a Sonnet module for measuring performance of each batch, and the following is the work I have done: import tensorflow as tf import sonnet as snt class Metrics(snt.AbstractModule): def __init__(self,…
Yurui Ming
  • 21
  • 4
0
votes
0 answers

How to compute the magnetic field by inputting current density data in Python?

I simulated a loop in Sonnet to compute the magnetic field in the middle of the Loop. Sonnet only shows the current density, but not the magnetic field so I downloaded the discrete current density data Points as a cvs file. The file now shows me the…
0
votes
0 answers

How to set weights to a sonnet nets module?

I am using the DeepMind Sonnet Library, https://sonnet.readthedocs.io/en/latest/ After defining a simple MLP, I run it with a mock datapoint in order to set the input shape. import tensorflow as tf import sonnet as snt mlp = snt.nets.MLP([32, 32,…
Florian Lalande
  • 494
  • 4
  • 13
0
votes
1 answer

CUDA for both Tensorflow1.x and Tensorflow2.x?

I have been working with Sonnet with Tensorflow1 for the past couple of years, but with the introduction of Tensorflow2.0 I moved to that system. Now, I am debugging something and I wanted to return to the TF1 setup. Since my move to TF2.0 I no…
VBence
  • 11
  • 3
0
votes
1 answer

snt.AbstractModule in dm-sonnet=2.0.0

I've been trying to run code written in 2017, which uses tensorflow=1.3.0 and dm-sonnet=1.14. Many of the packages required have become unavailable and I was drowning in dependency issues so I decided to rewrite the code in a new version of…