chainer implementatio of catgan (UNSUPERVISED AND SEMI-SUPERVISED LEARNING WITH CATEGORICAL GENERATIVE ADVERSARIAL NETWORKS)
Build the model
python catgan_train.py
generate the image in "fig" directory
python catgan_test.py
chainer catgan
Hello,
I keep getting this error when I try to compile your code:
GPU: -1
load MNIST dataset
Downloading train-images-idx3-ubyte.gz...
Done
Downloading train-labels-idx1-ubyte.gz...
Done
Downloading t10k-images-idx3-ubyte.gz...
Done
Downloading t10k-labels-idx1-ubyte.gz...
Done
Converting training data...
Done
Converting test data...
Done
Save output...
Done
Convert completed
epoch 1
Traceback (most recent call last):
File "catgan_train.py", line 164, in
fake_x=gen(z)
File "catgan_train.py", line 73, in call
h1=F.leaky_relu(self.bn0(self.l0(z),test),slope=0.1)
TypeError: call() takes exactly 2 arguments (3 given)
Could you please help? Thank you.
I use the Chainer v1.9.0, but got an AssertionError when i run the catgan_test.py. I guess that the version of Chainer we have used are different.
$ python catgan_test.py
Traceback (most recent call last):
File "catgan_test.py", line 70, in
fake_x=gen(z,test=True).data
File "catgan_test.py", line 53, in call
h1=F.leaky_relu(self.bn0(self.l0(z),test),slope=0.1)
File "/usr/local/lib/python2.7/dist-packages/chainer/links/connection/linear.py", line 72, in call
return linear.linear(x, self.W, self.b)
File "/usr/local/lib/python2.7/dist-packages/chainer/functions/connection/linear.py", line 79, in linear
return LinearFunction()(x, W, b)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 115, in call
self._check_data_type_forward(in_data)
File "/usr/local/lib/python2.7/dist-packages/chainer/function.py", line 182, in _check_data_type_forward
in_type = type_check.get_types(in_data, 'in_types', False)
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 46, in get_types
_get_type(name, i, x, accept_none) for i, x in enumerate(data))
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 46, in
_get_type(name, i, x, accept_none) for i, x in enumerate(data))
File "/usr/local/lib/python2.7/dist-packages/chainer/utils/type_check.py", line 60, in _get_type
isinstance(array, cuda.ndarray))
AssertionError
Sorry!! Got an ImportError: No module named net??
And how to train with my own dataset?
Thanks for the help
I am a little confused about the loss function of generator.
I think it should be L_gen=-d_entropy1(fake_y)+d_entropy2(fake_y)
load MNIST dataset
epoch 1
Traceback (most recent call last):
File "catgan_train.py", line 164, in
fake_x=gen(z)
File "catgan_train.py", line 73, in call
h1=F.leaky_relu(self.bn0(self.l0(z),test),slope=0.1)
TypeError: call() takes 2 positional arguments but 3 were given
Even after making above changes, I get this error..
load MNIST dataset epoch 1 Traceback (most recent call last): File "catgan_train.py", line 164, in <module> fake_x=gen(z) File "catgan_train.py", line 74, in __call__ h2=F.leaky_relu(self.bn1(self.l1(h1),test),slope=0.1) TypeError: __call__() takes 2 positional arguments but 3 were given
I removed test from all these 3 line..
h1=F.leaky_relu(self.bn0(self.l0(z)),slope=0.1)
h2=F.leaky_relu(self.bn1(self.l1(h1)),slope=0.1)
h3=F.leaky_relu(self.bn2(self.l2(h2)))
h4=F.sigmoid(self.l3(h3))
It still gives me this error..
load MNIST dataset
epoch 1
Traceback (most recent call last):
File "catgan_train.py", line 165, in
fake_y=dis(fake_x)
File "catgan_train.py", line 117, in call
h1=F.leaky_relu(self.bn0(self.l0(x)+F.gaussian(mu_array2,log_std_array2),test),slope=0.1)
TypeError: call() takes 2 positional arguments but 3 were given
So I removed test in other calls too... like this..
h1=F.leaky_relu(self.bn0(self.l0(x)+F.gaussian(mu_array2,log_std_array2)),slope=0.1)
h2=F.leaky_relu(self.bn1(self.l1(h1)+F.gaussian(mu_array3,log_std_array3)),slope=0.1)
h3=F.leaky_relu(self.bn2(self.l2(h2)+F.gaussian(mu_array4,log_std_array4)),slope=0.1)
h4=F.leaky_relu(self.bn3(self.l3(h3)+F.gaussian(mu_array5,log_std_array5)),slope=0.1)
h5=F.leaky_relu(self.bn4(self.l4(h4)+F.gaussian(mu_array6,log_std_array6)),slope=0.1)
h6=F.softmax(self.l5(h5))
It gives me this error..
load MNIST dataset
epoch 1
Traceback (most recent call last):
File "catgan_train.py", line 170, in
o_dis.zero_grads()
AttributeError: 'Adam' object has no attribute 'zero_grads'
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.