Thanks for great repository. I got an error while testing your code. Why it happens?
The versions of pytorch and cuda are 1.9.1 and 11.1, respectively.
Rank -1: random seed=65537
Rank -1: Namespace(amsgrad=False, batch_size=512, batch_steps=2, beta1=0.9, beta2=0.999, category=None, checkpoint_name='test_cifar10/checkpoint', config='configs/cifar10/macow/macow-base-var.json', cuda=True, data_path='../../../data/cifar-10', dataset='cifar10', epochs=15000, eps=1e-08, eval_batch_size=1000, grad_clip=0.0, image_size=32, init_batch_size=2048, local_rank=0, log=<_io.TextIOWrapper name='test_cifar10/log.txt' mode='w' encoding='UTF-8'>, log_interval=10, lr=0.001, lr_decay=0.999997, model_path='test_cifar10', n_bins=256.0, n_bits=8, nx=3072, rank=-1, recover=-1, result_path='test_cifar10/images', seed=65537, test_k=5, train_k=1, valid_epochs=10, warmup_steps=50, weight_decay=1e-06, workers=4, world_size=1)
Files already downloaded and verified
Data size: training: 50000, val: 10000
of Parameters: 51046555
Rank -1, init model: 2048 instances
Epoch: 1 (lr=0.000000, betas=(0.9, 0.999), eps=1.0e-08, amsgrad=False, lr decay=0.999997, clip=0.0, l2=1.0e-06, train_k=1)
Traceback (most recent call last):
File "train.py", line 506, in
main(args)
File "train.py", line 500, in main
train(args, train_loader, train_index, train_sampler, val_loader, val_data, val_index, wolf)
File "train.py", line 334, in train
loss_gen, loss_kl, loss_dequant = wolf.loss(data, y=y, n_bits=n_bits, nsamples=train_k)
File "/root/share/NF/wolf/wolf/wolf.py", line 242, in loss
return core(data, y=y, n_bits=n_bits, nsamples=nsamples)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, *kwargs)
File "/root/share/NF/wolf/wolf/wolf.py", line 78, in forward
u, log_probs_dequant = self.dequantizer.dequantize(x, nsamples=nsamples)
File "/root/share/NF/wolf/wolf/modules/dequantization/dequantizer.py", line 93, in dequantize
u, logdet = self.flow.fwdpass(epsilon, h)
File "/root/share/NF/wolf/wolf/flows/flow.py", line 73, in fwdpass
return self.forward(x, h, **kwargs)
File "/root/share/NF/wolf/wolf/modules/dequantization/dequantizer.py", line 134, in forward
out, logdet_accum = self.core.forward(input, h=h)
File "/root/share/NF/wolf/wolf/flows/multiscale_architecture.py", line 301, in forward
out, logdet = block.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/multiscale_architecture.py", line 102, in forward
out, logdet = step.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/macow.py", line 152, in forward
out, logdet = unit.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/macow.py", line 42, in forward
out, logdet_accum = self.conv1.forward(input, h=h)
File "/root/share/NF/wolf/wolf/flows/couplings/coupling.py", line 485, in forward
params = self.transform.calc_params(self.calc_params(input, h=h))
File "/root/share/NF/wolf/wolf/flows/couplings/transform.py", line 58, in calc_params
scale = logscale.mul(0.5).tanh_().mul(self.alpha).add(1.0)
RuntimeError: Output 1 of SplitBackward is a view and is being modified inplace. This view is an output of a function that returns multiple views. Inplace operators on such views is forbidden. You should replace the inplace operation by an out-of-place one.
Thanks for great repository. I got an error while testing your code. Why it happens? The versions of pytorch and cuda are 1.9.1 and 11.1, respectively.
Rank -1: random seed=65537 Rank -1: Namespace(amsgrad=False, batch_size=512, batch_steps=2, beta1=0.9, beta2=0.999, category=None, checkpoint_name='test_cifar10/checkpoint', config='configs/cifar10/macow/macow-base-var.json', cuda=True, data_path='../../../data/cifar-10', dataset='cifar10', epochs=15000, eps=1e-08, eval_batch_size=1000, grad_clip=0.0, image_size=32, init_batch_size=2048, local_rank=0, log=<_io.TextIOWrapper name='test_cifar10/log.txt' mode='w' encoding='UTF-8'>, log_interval=10, lr=0.001, lr_decay=0.999997, model_path='test_cifar10', n_bins=256.0, n_bits=8, nx=3072, rank=-1, recover=-1, result_path='test_cifar10/images', seed=65537, test_k=5, train_k=1, valid_epochs=10, warmup_steps=50, weight_decay=1e-06, workers=4, world_size=1) Files already downloaded and verified Data size: training: 50000, val: 10000 of Parameters: 51046555 Rank -1, init model: 2048 instances Epoch: 1 (lr=0.000000, betas=(0.9, 0.999), eps=1.0e-08, amsgrad=False, lr decay=0.999997, clip=0.0, l2=1.0e-06, train_k=1) Traceback (most recent call last): File "train.py", line 506, in
main(args)
File "train.py", line 500, in main
train(args, train_loader, train_index, train_sampler, val_loader, val_data, val_index, wolf)
File "train.py", line 334, in train
loss_gen, loss_kl, loss_dequant = wolf.loss(data, y=y, n_bits=n_bits, nsamples=train_k)
File "/root/share/NF/wolf/wolf/wolf.py", line 242, in loss
return core(data, y=y, n_bits=n_bits, nsamples=nsamples)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, *kwargs)
File "/root/share/NF/wolf/wolf/wolf.py", line 78, in forward
u, log_probs_dequant = self.dequantizer.dequantize(x, nsamples=nsamples)
File "/root/share/NF/wolf/wolf/modules/dequantization/dequantizer.py", line 93, in dequantize
u, logdet = self.flow.fwdpass(epsilon, h)
File "/root/share/NF/wolf/wolf/flows/flow.py", line 73, in fwdpass
return self.forward(x, h, **kwargs)
File "/root/share/NF/wolf/wolf/modules/dequantization/dequantizer.py", line 134, in forward
out, logdet_accum = self.core.forward(input, h=h)
File "/root/share/NF/wolf/wolf/flows/multiscale_architecture.py", line 301, in forward
out, logdet = block.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/multiscale_architecture.py", line 102, in forward
out, logdet = step.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/macow.py", line 152, in forward
out, logdet = unit.forward(out, h=h)
File "/root/share/NF/wolf/wolf/flows/macow.py", line 42, in forward
out, logdet_accum = self.conv1.forward(input, h=h)
File "/root/share/NF/wolf/wolf/flows/couplings/coupling.py", line 485, in forward
params = self.transform.calc_params(self.calc_params(input, h=h))
File "/root/share/NF/wolf/wolf/flows/couplings/transform.py", line 58, in calc_params
scale = logscale.mul(0.5).tanh_().mul(self.alpha).add(1.0)
RuntimeError: Output 1 of SplitBackward is a view and is being modified inplace. This view is an output of a function that returns multiple views. Inplace operators on such views is forbidden. You should replace the inplace operation by an out-of-place one.