Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'k_disc' is not defined, File "adda.py", line 125 #9

Open
sangin-fatemeh opened this issue Sep 13, 2021 · 1 comment

Comments

@sangin-fatemeh
Copy link

Hello all,
I have done the according steps as said in README.md file, and as I was running the adda.py file with the specified argument as followed: python adda.py trained_models/source.pt , I met this error after a long time on the code was under execution:

C:\Users\FSangin\AppData\Local\Programs\Python\Python38\lib\site-packages\torchvision\datasets\mnist.py:498: UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:180.) return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s) 0%| | 0/500 [00:00<?, ?it/s]C:\Users\FSangin\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ..\c10/core/TensorImpl.h:1156.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) Traceback (most recent call last): File "adda.py", line 125, in <module> main(args) File "adda.py", line 106, in main mean_loss = total_loss / (args.iterations*k_disc) NameError: name 'k_disc' is not defined

@saint1729
Copy link

Replace it with args.k_disc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants