Giter VIP home page Giter VIP logo

Comments (5)

zcboluo avatar zcboluo commented on August 10, 2024

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.

zcboluo avatar zcboluo commented on August 10, 2024

@yosinski I am waiting for you help. Thank you very much!

from fooling.

yosinski avatar yosinski commented on August 10, 2024

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.

zcboluo avatar zcboluo commented on August 10, 2024

@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.

zcboluo avatar zcboluo commented on August 10, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.