Comments (3)
Which line did it raise the error "Axis Error: axis -1 is out of bounds for array of dimension 0"?
from wgan-gp.
def flush():
prints = []
for name, vals in _since_last_flush.items():
prints.append("{}\t{}".format(name, np.mean(vals.values())))
_since_beginning[name].update(vals)
x_vals = np.sort(_since_beginning[name].keys())
y_vals = [_since_beginning[name][x] for x in x_vals]
plt.clf()
plt.plot(x_vals, y_vals)
plt.xlabel('iteration')
plt.ylabel(name)
plt.savefig(name.replace(' ', '_')+'.jpg')
First prints.append("{}\t{}".format(name, np.mean(vals.values())))
line thrown the error
Error: TypeError: unsupported operand type(s) for /: 'dict_values' and 'int'
Fix made:prints.append("{}\t{}".format(name, np.mean(list(vals.values()))))
Then the below two lines given the error
x_vals = np.sort(_since_beginning[name].keys())
y_vals = [_since_beginning[name][x] for x in x_vals]
Error:
line 845,in <module>
lib.plot.flush()
File "/Users/Jay/Documents/Andromeda/BitBucket_Networks/newnetworks/tflib/plot.py", line 28, in flush
x_vals = np.sort(_since_beginning[name].keys())
File "//anaconda/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 822, in sort
a.sort(axis=axis, kind=kind, order=order)
numpy.core._internal.AxisError: axis-1 is out of bounds for array of dimension 0
these two lines in Flush function in plot.py
from wgan-gp.
you should make the same change that you did above.
x_vals = np.sort(_since_beginning[name].keys())
becomes
x_vals = np.sort(list(_since_beginning[name].keys()))
from wgan-gp.
Related Issues (20)
- D_real.backward(mone) RuntimeError: invalid gradient at index 0 - expected shape [] but got [1] HOT 5
- why D_real.backward(one) and D_fake.backward(mone)? HOT 2
- AttributeError: 'generator' object has no attribute 'next' HOT 2
- sometimes loss is negative during training model HOT 1
- Discriminator requires_grad=False when training Generator
- bug in calc_gradient_penalty? HOT 1
- Mode Collapse WGAN
- It requires grad clip in original paper which seems to be ignored in this implementation. HOT 2
- How to download the language dataset?
- ValueError: Tensor._shape cannot be assigned, use Tensor.set_shape instead. HOT 3
- (op: 'FusedBatchNorm') with input shapes: [64,256,8,8], [256], [256], [0], [0].
- Penalizing Norm of Jacobian
- WGAN-gp loss keeps going large HOT 4
- A question about Dcost
- The aixs of norm of the gradient HOT 1
- The loss funciont is wrong in the implement? HOT 1
- Is the G_loss wrong?
- How does optimizer work when there are 3 backwards(real, fake, penalty)?
- how to decide the value of λ HOT 2
- 一堆错误 HOT 1
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 wgan-gp.