Giter Club home page Giter Club logo

Comments (4)

ZeliangM avatar ZeliangM commented on May 28, 2024

I meet the same problem!

from odl.

swpeng24 avatar swpeng24 commented on May 28, 2024

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...

from odl.

JevgenijaAksjonova avatar JevgenijaAksjonova commented on May 28, 2024

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, 2*np.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())

from odl.

ZeliangM avatar ZeliangM commented on May 28, 2024

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, 2*np.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)

from odl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.