You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using the classifier weights as the parameter group to be quantized, i do not have this error but the focus is to quantize the conv and downsample layers which gives the above error when i attempt training
Hi,
Trying TTQ on RESNET18 but getting a runtime error. Can't seem to find what the issue is:
/home/user2/Desktop/pttq/resnet_caltech/trained-ternary-quantization-master/utils/training.pyc in train(model, loss, optimization_step_fn, train_iterator, val_iterator, n_epochs, patience, threshold, lr_scheduler)
53
54 batch_loss, batch_accuracy, batch_top5_accuracy = optimization_step_fn(
---> 55 model, loss, x_batch, y_batch
56 )
57 running_loss += batch_loss
in optimization_step_fn(model, loss, x_batch, y_batch)
/home/user2/Desktop/pttq/resnet_caltech/trained-ternary-quantization-master/utils/quantization.py in optimization_step(model, loss, x_batch, y_batch, optimizer_list, t)
94
95 # get modified grads
---> 96 k_fp_grad, w_p_grad, w_n_grad = get_grads(k.grad.data, k_fp.data, w_p, w_n, t)
97
98 # grad for full precision kernel
/home/user2/Desktop/pttq/resnet_caltech/trained-ternary-quantization-master/utils/quantization.py in get_grads(kernel_grad, kernel, w_p, w_n, t)
39 c = torch.ones(kernel.size()).cuda() - a - b
40 # scaled kernel grad and grads for scaling factors (w_p, w_n)
---> 41 return w_pakernel_grad + w_nbkernel_grad + 1.0ckernel_grad,
42 (akernel_grad).sum(), (bkernel_grad).sum()
43
/usr/local/lib/python2.7/dist-packages/torch/tensor.pyc in mul(self, other)
319
320 def mul(self, other):
--> 321 return self.mul(other)
322 rmul = mul
323
RuntimeError: invalid argument 3: sizes do not match at /pytorch/torch/lib/THC/generated/../generic/THCTensorMathPointwise.cu:351
The text was updated successfully, but these errors were encountered: