psandovalsegura / autoregressive-poisoning

Code for the paper "Autoregressive Perturbations for Data Poisoning" (NeurIPS 2022)
MIT License
18 stars 5 forks source link

running error #2

Open Syloveslife opened 3 months ago

Syloveslife commented 3 months ago

Hi, sir, when I ran this command “python autoregressive_param_finder.py --total=10 --required_nm_response=10 --gen_norm_upper_bound=50”, an error occurred. As follows:

Traceback (most recent call last): File "autoregressive_param_finder.py", line 83, in main() , einops [0/1168] File "autoregressive_param_finder.py", line 38, in main gen, gen_norm = ar_p.generate(eps=1.0, p=2, size=(36,36), crop=4) File "/ar/autoregressive.py", line 44, in generate val = torch.nn.functional.conv2d(start_signal[:,i:i+kernel_size,j:j+kernel_size], ar_coeff, groups=self.num_channels) RuntimeError: Expected 4-dimensional input for 4-dimensional weight [3, 1, 3, 3], but got 3-dimensional input of size [3, 3, 3] instead

How can I resolve it?

psandovalsegura commented 3 months ago

What's your torch version? You can run python -c "import torch; print(torch.__version__)"

The command you posted is working for me on torch==2.3.1