d12306 / dsnet Goto Github PK
View Code? Open in Web Editor NEWCode for ICML'21 paper Learning Diverse-Structured Networks for Adversarial Robustness
Code for ICML'21 paper Learning Diverse-Structured Networks for Adversarial Robustness
I ran your code with torch 1.9.0+cu111, python 3.8.5. The command was python train_ds_net.py --gpu 0 --start_evaluation 0 --note xxx --factor 4 --init_channel 20 --trades_beta 6 --is_trades 0 --is_mart 0 --is_at 0 --epsilon 0.031 --is_softmax 1 --is_normal 1 --use_amp 1 --epochs 120 --step_size 0.007 --seed 0
. But an error raised:
Warning: multi_tensor_applier fused unscale kernel is unavailable, possibly because apex was installed without --cuda_ext --cpp_ext. Using Python fallback. Original ImportError was: ModuleNotFoundError("No module named 'amp_C'")
==> Adversarial Training
param size = 20.780245MB
current lr: 0.1
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
File "train_ds_net.py", line 486, in
run_name="mp_main")logger_loss)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 263, in run_path
File "train_ds_net.py", line 235, in train
pkg_name=pkg_name, script_name=fname)for batch_idx, (data, target) in enumerate(train_loader):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 96, in _run_module_code
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 359, in iter
mod_name, mod_spec, pkg_name, script_name)return self._get_iterator()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 305, in _get_iterator
exec(code, run_globals)return _MultiProcessingDataLoaderIter(self)
File "D:\dsnet-main\train_ds_net.py", line 486, in
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 918, in init
logger_loss)w.start()
File "D:\dsnet-main\train_ds_net.py", line 235, in train
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start
for batch_idx, (data, target) in enumerate(train_loader):self._popen = self._Popen(self)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 359, in iter
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 223, in _Popen
return self._get_iterator()return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 305, in _get_iterator
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen
return _MultiProcessingDataLoaderIter(self)return Popen(process_obj)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 918, in init
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
w.start()reduction.dump(process_obj, to_child)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py", line 60, in dump
self._popen = self._Popen(self)ForkingPickler(file, protocol).dump(obj)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 223, in _Popen
BrokenPipeError : return _default_context.get_context().Process._Popen(process_obj)[Errno 32] Broken pipe
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 33, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 143, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\multiprocessing\spawn.py", line 136, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Why is that? How can I solve it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.