Comments (5)
Hi, @Luke06! Please see the following comment about how to download h5
files without corrupting their integrity: h5py/h5py#757 (comment) Let me know if this solves the issue. Also, the model was created with keras==2.2.2
; please consider using the same version to make sure that you can load it.
from adversarial-robustness-toolbox.
Hi
I looked at the comment but I don't see how it fix my problem , Iam using the std keras library to load the model and the file is they one from the ART repo that I retrieve thru a wget in my python notebook. the downloaded file seems to be correct. I am in Keras 2.2.4 ! but cannot move back to 2.2.2 due to others incompatibilities in my code :(. in fact my goal is to retrain my model using your defence training libraries but it was not working neither so....
from adversarial-robustness-toolbox.
@Luke06 I have tested your scenario. Loading the model does not work for me neither if I download it using wget
. Actually, the model from the repo and the one downloaded with wget
don't even have the same size on disk (I get 44357 for wget
, just the same as you, and 2737408 for the model downloaded properly). That is what the comment I pointed you towards explains. You could clone the repo or use the solution in the comment to make sure you get a valid version of the file.
On a different note, if your goal is to train an architecture that you already have with the defenses from the library, you don't necessarily need to download the pre-trained models that we use as examples.
from adversarial-robustness-toolbox.
OK I understand the problem with the downloaded h5 file.
Yes my initial goal was to retrain my model using the defences from the libraries but I was encountering some issues probably due to invalid usage of the library, here is the code I tried to use
I have defined a CNN model called model and I create a Classifier wrapper :
Original_Classifier = KerasClassifier((0,1),model,use_logits=False)
Original_Classifier.fit(x_train, y_train, batch_size=128, nb_epochs=10)
Then I tried this lines that I found in the notebook sample called adversarial-training-mnist.ipynb
attacks = BasicIterativeMethod(Original_Classifier,eps=0.3,eps_step=0.01, max_iter=40)
trainer = AdversarialTrainer(Original_Classifier,attacks,ratio=1.0)
trainer.fit(x_train,y_train, nb_epochs=10,batch_size=50)
but the training ended after the 1 epochs with very strange results.
Can you pls provide me with the right way & sample code of doing that for my training against Fast Gradient Method attack ?
by advance thanks a lot
from adversarial-robustness-toolbox.
I would say that your original problem (.h5
files) is solved, so I will close this issue.
I don't see any obvious error in your code example. Would you mind opening a new issue for it, where you would copy the code example, as well as the full stack trace of the error you are getting when running it?
from adversarial-robustness-toolbox.
Related Issues (20)
- Incorrect Documentation regarding attacks.poisoning HOT 1
- Auto PGD not working with DLR loss for binary classification HOT 1
- ERROR collecting tests/attacks/evasion/test_brendel_and_bethge.py
- Measured Linf norm exceeds epsilon for ACG HOT 1
- Risky values in tests
- Gradient Explosion
- Robust
- Rr
- adversarial audio example notebook not giving the same results HOT 2
- Unable to utilize PytorchClassifier for ASR model HOT 1
- List of projects/tools utilising ART [JATIC-I4-IBM]
- Attack > Evasion > Momentum Iterative Method: major issues HOT 1
- Package cannot be imported after installing with pip HOT 3
- Deprecated `pkg_resources` raises `DeprecationWarning`s HOT 3
- UserWarning and RuntimeError in ProjectedGradientDescent due to Non-Writable NumPy Array and Device Mismatch HOT 1
- Acknowledged contributor (mistakenly?) removed from `AUTHORS` off-PR HOT 2
- KerasClassifier not compatible with latest versions of Keras and TensorFlow HOT 1
- Yolox Integration
- Semantic version checking in some modules/tests do not account for epoch, pre/post-release, or development release segments HOT 1
- float type mismatch
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 adversarial-robustness-toolbox.