Comments (5)
I have seen the closed issue about"no attribute 'backward_from_layer'"and sovled this problem.
But another problem has occurred:
grad: 0.0 0.0 0.0
Grad 0, failed
Result: no convergence
the grad is always 0, it may because:
code: " diffs = net.blobs[push_layer].diff * 0 " in the "find_fooling_image.py"
or it may result from that I used the model 'bvlc_reference_caffenet.caffemodel' instead, because I couldn't download the trained model from 'http://yosinski.cs.cornell.edu/yos_140311__caffenet_iter_450000'.
Where can I download it?
from fooling.
@yosinski I am waiting for you help. Thank you very much!
from fooling.
Hi @zcboluo, sorry for the inactive URL. Try this one instead:
http://c.yosinski.com/caffenet-yos-weights
Does that work? If not, make sure you're using a network definition prototext containing the force_backward: true
line like as in ours:
https://github.com/Evolving-AI-Lab/fooling/blob/ascent/caffe/ascent/deploy_1_forcebackward.prototxt#L7
from fooling.
@yosinski Thank you very much. The model works. But I have a new problem:
When I put the generated picture back in the model, the results is different.
These is the code ():
im=caffe.io.load_image('291_maj_Xpm.png')
tmp = transformer.preprocess('data', im) # converts rgb -> bgr
X0 = tmp[newaxis,:]
X = minimum(255.0, maximum(0.0, X0 + mn4d)) - mn4d # Crop all values to [0,255]
out = net.forward_all(data = X)
acts = net.blobs['prob'].data
iimax = unravel_index(acts.argmax(), acts.shape)[1:] # chop off batch idx of 0
push_label = labels[push_idx]
print 'Push idx: %d, val: %g (%s)\n Max idx: %d, val: %g (%s)' % (push_idx, acts[0][push_idx], push_label, iimax[0], acts.max(), labels[iimax[0]])
However, when replace 'im' with 'best_X'(return from the fuction 'find_image'). The result is the same.
Why ‘im’ is different from 'best_X'? So I wonder if there is any mistake I have not noticed.
from fooling.
@yosinski
I found that the code ‘X = minimum(255.0, maximum(0.0, X + mn4d)) - mn4d # Crop all values to [0,255]’ didn't really make 'X' in [0,255]. I wonde if this is the reason?
from fooling.
Related Issues (15)
- boost_mpi HOT 5
- ERROR occurs when type command: make all HOT 4
- Docker image? HOT 2
- ld cannot find -lcaffe HOT 1
- Mnist experiment: generated images and prediction probabilities don't change over generations HOT 4
- Error in step "caffe make runtest" and "run mnist experiment" HOT 1
- A request
- no attribute 'backward_from_layer' HOT 6
- std::signbit<float> is not allowed
- Error with MPI on Ubuntu HOT 1
- Unable to generate MNIST example HOT 3
- Unable to load .caffemodel weights HOT 4
- ImageDataLayer: Check failed: num_images <= batch_size (10 vs. 1) HOT 1
- Could not run ./waf --exp images
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 fooling.