I cloned and run the code on Google Colab and I faced two problems:
The first one was caused by "apex.amp" and it was the following one:
cannot import name 'UnencryptedCookieSessionFactoryConfig' from 'pyramid.session'
I was able to run the code by replacing apex.amp with torch.cuda.amp in both deepinversion.py and imagenet_inversion.py
The second one was caused by Tensor.view():
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
So I replaced in imagenet_inversion.py (line 47)
correct_k = correct[:k].view(-1).float().sum(0)
with
correct_k = correct[:k].reshape(-1).float().sum(0)
Thanks to these two adjustements I was able to run the code without any further problems.
I cloned and run the code on Google Colab and I faced two problems:
The first one was caused by "apex.amp" and it was the following one:
cannot import name 'UnencryptedCookieSessionFactoryConfig' from 'pyramid.session'
I was able to run the code by replacing apex.amp with torch.cuda.amp in both deepinversion.py and imagenet_inversion.pyThe second one was caused by Tensor.view():
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
So I replaced in imagenet_inversion.py (line 47)
correct_k = correct[:k].view(-1).float().sum(0)
withcorrect_k = correct[:k].reshape(-1).float().sum(0)
Thanks to these two adjustements I was able to run the code without any further problems.