hiromu / robust_audio_ae

Robust Audio Adversarial Example for a Physical Attack
BSD 2-Clause "Simplified" License
60 stars 20 forks source link

Error with record.py #7

Closed StephenC808 closed 2 years ago

StephenC808 commented 3 years ago

I can run run attack.py and generate adversarial examples without issue but afterwards, when I run record.py, I get the following errors. I am wondering what is record.py actually doing if the adversarial examples have been created and stored in the results directory already?

/home/asd/robust/local/lib/python2.7/site-packages/librosa/core.py:25: UserWarning: Could not import scikits.samplerate. Falling back to scipy.signal 'Falling back to scipy.signal') ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave TypeError: argument 1 must be string or read-only buffer, not list Traceback (most recent call last): File "record.py", line 68, in main(sys.argv[1], sys.argv[2]) File "record.py", line 38, in main outdata = np.array(librosa.load(out_path, fs)[0], dtype=np.float32) File "/home/asd/robust/local/lib/python2.7/site-packages/librosa/core.py", line 76, in load with audioread.audio_open(os.path.realpath(path)) as input_file: File "/home/asd/robust/local/lib/python2.7/site-packages/audioread/init.py", line 111, in audio_open return BackendClass(path) File "/home/asd/robust/local/lib/python2.7/site-packages/audioread/rawread.py", line 62, in init self._fh = open(filename, 'rb') IOError: [Errno 2] No such file or directory: '/home/asd/robust/robust_audio_ae1/ae.wav' Exception TypeError in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored

hiromu commented 2 years ago

The record.py is intended for playing generated adversarial examples to evaluate their attack success rate. You don't need to run this script if you just want to generate adversarial examples.