Comments (5)
Hello, I need all your command line inputs to check whether your command line args are wrong or there are bugs in code.
from backdoorbench.
Try this. I have already go through all of them and successfully start the attack.
# go to resource/ssba !
python dataset_convert_into_images.py --dataset cifar10
mkdir jul29
python train.py \
--data_dir ../../data/cifar10_seperate_images/train \
--output_dir ./jul29 \
--EXP_NAME jul29 \
--random_seed 0 \
--fingerprint_length 100 \
--image_resolution 32 \
--num_epochs 20 \
--batch_size 64 \
--use_residual 0 \
--use_modulated 0 \
--fc_layers 0 \
--fused_conv 0
# embedding training dataset
python embed_fingerprints.py \
--encoder_path ./jul29/checkpoints/jul29_encoder.pth \
--data_dir ../../data/cifar10_seperate_images/train \
--output_dir ../../data/cifar10_seperate_images/train_encode \
--image_resolution 32 \
--identical_fingerprints \
--check \
--decoder_path ./jul29/checkpoints/jul29_decoder.pth \
--batch_size 64 \
--seed 0 \
--encode_method bch \
--secret secret \
--use_residual 0 \
--use_modulated 0 \
--fused_conv 0 \
--fc_layers 0 \
--cuda 0
# pack images into npy file
python utils/pack_images.py \
--path ../../data/cifar10_seperate_images/train_encode \
--save_file_path ../../data/cifar10_seperate_images/train_encode.npy
# embedding test dataset
python embed_fingerprints.py \
--encoder_path ./jul29/checkpoints/jul29_encoder.pth \
--data_dir ../../data/cifar10_seperate_images/test \
--output_dir ../../data/cifar10_seperate_images/test_encode \
--image_resolution 32 \
--identical_fingerprints \
--check \
--decoder_path ./jul29/checkpoints/jul29_decoder.pth \
--batch_size 64 \
--seed 0 \
--encode_method bch \
--secret secret \
--use_residual 0 \
--use_modulated 0 \
--fused_conv 0 \
--fc_layers 0 \
--cuda 0
# pack images into npy file
python utils/pack_images.py \
--path ../../data/cifar10_seperate_images/test_encode \
--save_file_path ../../data/cifar10_seperate_images/test_encode.npy
# go to root of backdoorbench first !
python attack/ssba.py --attack_train_replace_imgs_path ../data/cifar10_seperate_images/train_encode.npy --attack_test_replace_imgs_path ../data/cifar10_seperate_images/test_encode.npy
from backdoorbench.
ok,thanks for you.
Try this. I have already go through all of them and successfully start the attack.
# go to resource/ssba ! python dataset_convert_into_images.py --dataset cifar10 mkdir jul29 python train.py \ --data_dir ../../data/cifar10_seperate_images/train \ --output_dir ./jul29 \ --EXP_NAME jul29 \ --random_seed 0 \ --fingerprint_length 100 \ --image_resolution 32 \ --num_epochs 20 \ --batch_size 64 \ --use_residual 0 \ --use_modulated 0 \ --fc_layers 0 \ --fused_conv 0 # embedding training dataset python embed_fingerprints.py \ --encoder_path ./jul29/checkpoints/jul29_encoder.pth \ --data_dir ../../data/cifar10_seperate_images/train \ --output_dir ../../data/cifar10_seperate_images/train_encode \ --image_resolution 32 \ --identical_fingerprints \ --check \ --decoder_path ./jul29/checkpoints/jul29_decoder.pth \ --batch_size 64 \ --seed 0 \ --encode_method bch \ --secret secret \ --use_residual 0 \ --use_modulated 0 \ --fused_conv 0 \ --fc_layers 0 \ --cuda 0 # pack images into npy file python utils/pack_images.py \ --path ../../data/cifar10_seperate_images/train_encode \ --save_file_path ../../data/cifar10_seperate_images/train_encode.npy # embedding test dataset python embed_fingerprints.py \ --encoder_path ./jul29/checkpoints/jul29_encoder.pth \ --data_dir ../../data/cifar10_seperate_images/test \ --output_dir ../../data/cifar10_seperate_images/test_encode \ --image_resolution 32 \ --identical_fingerprints \ --check \ --decoder_path ./jul29/checkpoints/jul29_decoder.pth \ --batch_size 64 \ --seed 0 \ --encode_method bch \ --secret secret \ --use_residual 0 \ --use_modulated 0 \ --fused_conv 0 \ --fc_layers 0 \ --cuda 0 # pack images into npy file python utils/pack_images.py \ --path ../../data/cifar10_seperate_images/test_encode \ --save_file_path ../../data/cifar10_seperate_images/test_encode.npy # go to root of backdoorbench first ! python attack/ssba.py --attack_train_replace_imgs_path ../data/cifar10_seperate_images/train_encode.npy --attack_test_replace_imgs_path ../data/cifar10_seperate_images/test_encode.npy
thanks for you, I try to use your command and successfully.
from backdoorbench.
Hi,
Thanks for sharing your wonderful work.
I met the following errors when reproducing the SSBA algorithm:
python embed_fingerprints.py --encoder_path ./jul29/checkpoints/jul29_encoder.pth --data_dir ../../data/cifar10_seperate_images/train --output_dir ../../data/cifar10_seperate_images/train_encode --image_resolution 32 --identical_fingerprints --check --decoder_path ./jul29/checkpoints/jul29_decoder.pth --batch_size 64 --seed 0 --encode_method bch --secret secret --use_residual 0 --use_modulated 0 --fused_conv 0 --fc_layers 0 --cuda 0
use_celeba_preprocessing False <
encoder_path ./jul29/checkpoints/jul29_encoder.pth <
data_dir ../../data/cifar10_seperate_images/train <
output_dir ../../data/cifar10_seperate_images/train_encode <
image_resolution 32 <
identical_fingerprints True <
check True <
decoder_path ./jul29/checkpoints/jul29_decoder.pth <
batch_size 64 <
cuda 0 <
use_residual 0 <
encode_method bch <
secret secret <
seed 0 <
diff_bits 0 <
manual_str None <
proportion 1.0 <
use_modulated 0 <
fc_layers 0 <
fused_conv 0 <
bias_init None <
test_save_file None <
poison_rate 1.0 <
Loading image folder ../../data/cifar10_seperate_images/train ...
Finished. Loading took 0.23s
----------Not using modulated conv!----------
Fingerprinting the images...
Using bch code with secret string: secret
Traceback (most recent call last):
File "embed_fingerprints.py", line 281, in
main()
File "embed_fingerprints.py", line 278, in main
embed_fingerprints()
File "embed_fingerprints.py", line 171, in embed_fingerprints
identical = args.identical_fingerprints)
File "/home/backdoor/ssba/generate_fingerprints.py", line 63, in generate_fingerprints
fingerprints = generate_fingerprints_from_bch(fingerprint_size, secret)
File "/home/backdoor/ssba/generate_fingerprints.py", line 13, in generate_fingerprints_from_bch
bch = bchlib.BCH(BCH_POLYNOMIAL, BCH_BITS)
RuntimeError: unable to inititalize bch, invalid parameters?
_
from backdoorbench.
您好, 感谢您分享您的精彩工作。
我在重现SSBA算法时遇到以下错误:
python embed_fingerprints.py --encoder_path ./jul29/checkpoints/jul29_encoder.pth --data_dir ../../data/cifar10_seperate_images/train --output_dir ../../data/cifar10_seperate_images/train_encode --image_resolution 32 -- same_fingerprints --check --decoder_path ./jul29/checkpoints/jul29_decoder.pth --batch_size 64 --seed 0 --encode_method bch --secret 秘密 --use_residual 0 --use_modulated 0 --fused_conv 0 --fc_layers 0 -- cuda 0 use_celeba_preprocessing False < 编码器路径./jul29/checkpoints/jul29_encoder.pth < data_dir ../../data/cifar10_seperate_images/train < output_dir ../../data/cifar10_seperate_images/train_encode < image_resolution 32 < Same_fingerprints True < check True < 解码器路径./jul29/checkpoints/jul29_decoder.pth < batch_size 64 < cuda 0 < use_residual 0 < encode_method bch < 秘密秘密< 种子0< diff_bits 0< manual_str无< 比例1.0< use_modulated 0< fc_layers 0< fused_conv 0< bias_init无< test_save_file无< poison_rate 1.0< 正在加载图像文件夹../../data/cifar10_seperate_images/train ... 已完成。加载花费了 0.23 秒 ---------- 不使用调制转换!------------ 对图像进行指纹识别... 使用带有秘密字符串的 bch 代码:秘密 回溯(最近一次调用最后一次) : 文件“embed_fingerprints.py”,第281行,在 main() 中文件“embed_fingerprints.py”,第278行,在main embed_fingerprints()中 文件“embed_fingerprints.py”,第171行,在embed_fingerprints中 相同= args.identical_fingerprints) 文件“ /home/backdoor/ssba/generate_fingerprints.py”,第 63 行,generate_fingerprints Fingerprints =generate_fingerprints_from_bch(fingerprint_size, Secret) 文件“/home/backdoor/ssba/generate_fingerprints.py”,第 13 行,generate_fingerprints_from_bch bch = bchlib.BCH( BCH_POLYNOMIAL,BCH_BITS) 运行时错误:无法初始化bch,参数无效? _
In the file "embed_fingerprints.py", there is a line "bch = bchlib.BCH(BCH_POLYNOMIAL, BCH_BITS)". It should be "bch = bchlib.BCH(BCH_BITS, BCH_POLYNOMIAL)". By this, I solved the same error.
from backdoorbench.
Related Issues (20)
- Errors when we execute shell script
- LC attack source HOT 1
- missing resource
- can not generate trigger for low frequency attack HOT 2
- Target Class of Label-Consistent in the Google Drive
- 您好,很敬佩该工作对于后门攻击的总结。 想请问下为什么 v1 里的 ft_attack 频域后门攻击 在v2 里被移除了呢
- How to use this library in an incremental manner? HOT 1
- Implementation issue with ANP HOT 3
- Poison Index Selection - Clean label case HOT 3
- bpp attack source HOT 2
- Backdoor OneDrive Access Unavailable HOT 5
- About Missing Clean Model for TrojanNN Attack Implementation HOT 2
- RuntimeError: DataLoader worker (pid(s) 35464) exited unexpectedly HOT 1
- How can i use the Vit model.pt ? HOT 1
- can not generate trigger using low frequency attack for resnet18 HOT 1
- low test acc in the lira attack experimental HOT 1
- Is there an error in the calculation of outlier score in spectral.py HOT 2
- Model Zoo and Onedrive link cannot be accessed HOT 4
- CTRL
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 backdoorbench.