Open lofux opened 2 years ago
I meet the same problem!
Just lower your pytorch version to below 1.3, but I am also solving this problem that occurs above version 1.3, and I am researching...
Hi,
I am using almost the latest pytorch (1.12.1.post201) and I have no such problem with the binding. I imagine that part3_learned_reconstruction_pytorch.ipynb can have some outdated code, however the following code runs as expected:
import matplotlib.pyplot as plt import numpy as np import odl import torch from odl.contrib.torch import OperatorModule
print(torch.version)
X = odl.uniform_discr([-10, -10], [10, 10], (100,100)) x = odl.phantom.shepp_logan(X)
apart = odl.uniform_partition(0, 2np.pi, 100) dpart = odl.uniform_partition(-30, 30, 100) geometry = odl.tomo.FanBeamGeometry(apart=apart, dpart=dpart, src_radius=15, det_radius=15) operator = odl.tomo.RayTransform(X, geometry) pt_op = OperatorModule(operator) pt_x = torch.from_numpy(x.asarray().reshape(1,1,x.shape)).cuda()
plt.imshow(pt_op(pt_x).detach().cpu().numpy().squeeze())
Hi,
I am using almost the latest pytorch (1.12.1.post201) and I have no such problem with the binding. I imagine that part3_learned_reconstruction_pytorch.ipynb can have some outdated code, however the following code runs as expected:
import matplotlib.pyplot as plt import numpy as np import odl import torch from odl.contrib.torch import OperatorModule
print(torch.version)
X = odl.uniform_discr([-10, -10], [10, 10], (100,100)) x = odl.phantom.shepp_logan(X)
apart = odl.uniform_partition(0, 2np.pi, 100) dpart = odl.uniform_partition(-30, 30, 100) geometry = odl.tomo.FanBeamGeometry(apart=apart, dpart=dpart, src_radius=15, det_radius=15) operator = odl.tomo.RayTransform(X, geometry) pt_op = OperatorModule(operator) pt_x = torch.from_numpy(x.asarray().reshape(1,1,x.shape)).cuda()
plt.imshow(pt_op(pt_x).detach().cpu().numpy().squeeze())
I still meet error when use your example.(pytorch==1.10.0,1.8.0)
Hi!
I am trying to run the jupyter notebook: part3_learned_reconstruction_pytorch.ipynb from the odlworkshop . I use pytorch 1.7.0 and cuda 10.1.
I get the following error message:
RuntimeError Traceback (most recent call last)