Comments (4)
Thanks Ivan, we certainly need to improve the documentation.
Would you have expected a different syntax to specify a custom session? Maybe we can make it easier to use TensorFlowModel
.
from foolbox.
Maybe there could be an optional argument for a user-defined session in the TensorFlowModel
:
TensorFlowModel(images, logits, bounds, channel_axis=3, user_session=None)
If no session if provided, then TensorFlowModel
can do what it does now, but maybe also throw a warning that a new session has been created and some variables have been initialised to their default values.
from foolbox.
I added a new page in the documentation with examples, in particular lot's of examples of the different ways to create a foolbox.models.TensorFlowModel
: https://foolbox.readthedocs.io/en/latest/user/examples.html
@ivust What you are using right now is basically Option 4. Have a look at the other options, I think Option 1, Option 2 and Option 3 are nicer.
Your proposal,
session = tf.Session()
restorer.restore(session, '/path/to/vgg_19.ckpt')
model = foolbox.models.TensorFlowModel(images, logits, (0, 255), session=session)
print(np.argmax(model.predictions(image)))
session.close()
is basically a fifth option that's almost identical to Option 3 and therefore will not be implemented for now (I would however accept pull-requests for this, if you really want it).
from foolbox.
Considering this solved. @ivust let me know if I missed something.
from foolbox.
Related Issues (20)
- Example Code Running Failed HOT 1
- [tests/test_models] The results of `transform_bounds` are inconsistent between CPU and GPU. HOT 3
- Are there any plans to support attacks on TFLite models? HOT 1
- Changing CUDA device at runtime HOT 1
- Logit optimization
- about PGD attack HOT 2
- specifying criterion fails with TypeError HOT 2
- "nll_loss_forward_no_reduce_cuda_kernel_index" not implemented for 'Float' HOT 3
- Deprecation warning using old scipy namespace for gaussian_filter
- how to define the bounds HOT 2
- About the pgd attacks HOT 1
- how to use GaussianBlurAttack HOT 1
- FGSM TargetedMisclassfication HOT 1
- Use foolbox for multi-label classification HOT 1
- Local datasets supported?
- Is there a criterion for query budget? HOT 1
- It seems like the 'success' value in the return of the 'attack' function is overconfident. HOT 2
- About Carlini-Wagner Attack
- Are the wrong classified images sorted out? HOT 1
- It seems your CI/CD has a bug. 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 foolbox.