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

Unable to train getting this error: "TypeError: ActNorm1dFlow.forward: kwargs is not present." #3

Open
JTdeep opened this issue May 19, 2021 · 2 comments

Comments

@JTdeep
Copy link

JTdeep commented May 19, 2021

Hello!

I am getting an error TypeError: ActNorm1dFlow.forward: kwargs is not present.

This is still occurs regardless of config file or the dataset being used.
Still happens after clean installs of the packages and also when trying the previous MaCow repository.
How can I resolve this?

Thank you for the help!!!

Terminal:
 (wolf) (base) james@LXMint:/media/james/LinuxStorage/Bayes/wolf/experiments$ python -u train.py \
 >     --config  configs/cifar10/macow/macow-base-var.json \
 >     --epochs 15000 --valid_epochs 10 \
 >     --batch_size 512 --batch_steps 2 --eval_batch_size 1000 --init_batch_size 2048 \
 >     --lr 0.001 --beta1 0.9 --beta2 0.999 --eps 1e-8 --warmup_steps 50 --weight_decay 1e-6 --grad_clip 0 \
 >     --image_size 32 --n_bits 8 \
 >     --data_path data/cifar10 --model_path models

Traceback (most recent call last):
  File "train.py", line 23, in <module>
    from wolf.data import load_datasets, get_batch, preprocess, postprocess
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/__init__.py", line 3, in <module>
    from wolf.wolf import WolfModel
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/wolf.py", line 12, in <module>
    from wolf.modules import DeQuantizer
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/modules/__init__.py", line 3, in <module>
    from wolf.modules.dequantization import *
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/modules/dequantization/__init__.py", line 3, in <module>
    from wolf.modules.dequantization.dequantizer import DeQuantizer, UniformDeQuantizer, FlowDeQuantizer
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/modules/dequantization/dequantizer.py", line 9, in <module>
    from wolf.flows.flow import Flow
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/flows/__init__.py", line 4, in <module>
    from wolf.flows.normalization import ActNorm1dFlow, ActNorm2dFlow
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/flows/normalization.py", line 13, in <module>
    class ActNorm1dFlow(Flow):
  File "/media/james/LinuxStorage/Bayes/wolf/wolf/flows/normalization.py", line 26, in ActNorm1dFlow
    def forward(self, input: torch.Tensor, mask: Union[torch.Tensor, None] = None) -> Tuple[torch.Tensor, torch.Tensor]:
  File "/media/james/LinuxStorage/Bayes/wolf/lib/python3.7/site-packages/overrides/overrides.py", line 88, in overrides
    return _overrides(method, check_signature, check_at_runtime)
  File "/media/james/LinuxStorage/Bayes/wolf/lib/python3.7/site-packages/overrides/overrides.py", line 114, in _overrides
    _validate_method(method, super_class, check_signature)
  File "/media/james/LinuxStorage/Bayes/wolf/lib/python3.7/site-packages/overrides/overrides.py", line 135, in _validate_method
    ensure_signature_is_compatible(super_method, method, is_static)
  File "/media/james/LinuxStorage/Bayes/wolf/lib/python3.7/site-packages/overrides/signature.py", line 95, in ensure_signature_is_compatible
    super_sig, sub_sig, super_type_hints, sub_type_hints, is_static, method_name
  File "/media/james/LinuxStorage/Bayes/wolf/lib/python3.7/site-packages/overrides/signature.py", line 136, in ensure_all_kwargs_defined_in_sub
    raise TypeError(f"{method_name}: `{name}` is not present.")
TypeError: ActNorm1dFlow.forward: `kwargs` is not present.
@JTdeep JTdeep changed the title Unable to train Unable to train. "TypeError: ActNorm1dFlow.forward: kwargs is not present." May 19, 2021
@JTdeep JTdeep changed the title Unable to train. "TypeError: ActNorm1dFlow.forward: kwargs is not present." Unable to train getting this error: 'TypeError: ActNorm1dFlow.forward: kwargs is not present.' May 19, 2021
@JTdeep JTdeep changed the title Unable to train getting this error: 'TypeError: ActNorm1dFlow.forward: kwargs is not present.' Unable to train getting this error: "TypeError: ActNorm1dFlow.forward: kwargs is not present." May 19, 2021
@Kim-Dongjun
Copy link

To JTdeep,

I have solved the problem.

The problem was the version of overrides.

You may try with overrides 3.1.0.

@JTdeep
Copy link
Author

JTdeep commented Jul 26, 2021

@Kim-Dongjun thank you! I will try it later :)

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