Giter VIP home page Giter VIP logo

ctlib's People

Contributors

xiawj-hub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ctlib's Issues

Docker cannot access

Hi Wenjun, when I was trying to pull the docker on Linux 18.04, CUDA 11.3 pytorch 1.10.0, using command 'pull xwj90620/ctlib_pytorch:1.0', it shows permission denied. Do you know why this happens? Thanks.

Best,
Dayang

error about CTLIB

Dear Teacher:
Thx for your job!
I have installed the package successfully,
but the error when I call for it
AttributeError: module 'ctlib' has no attribute 'backprojection_sv'.
图片
The code in the picture seems that the package has no these method.

Best
star

I got RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn using CTLIB library.

Hello Teacher:
I really appreciate your great CT geometry library.

I am now implementing "deep image prior" using ctlib library, but I had some errors.
(exactly, I am doing sparse-view CT reconstruction)

For simplicity, I attached my code (Training network parts)
...
input_train = data['input'].to(device) # gaussian
target_train = data['target'].to(device) # sparse-view image

output = net(input_train) # simple UNet

out_for_loss = ctlib.projection(output, option_sparse) # forward projection with sparse view (num of projection views)
out_for_loss = ctlib.fbp(output, option_sparse)

optim.zero_grad()
loss = fn_loss(out_for_loss , target_train )
loss.backward()
optim.step()

train_total_loss += [loss.item()]
....

What I want to do is, the output of network should be reconstructed into sparse-view CT images by applying forward projection and back-projection with option_sparse sequentially and then calculate the MSE loss with target image.

But I encountered a problem with
"RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn"
thus, loss.backward() is not calculated.

For other solutions, people said that write " loss = Variable(loss, requires_grad=True)".

I also did that and aforementioned RuntimeError disappeared, but the loss was not updated (constant for every epoch).

I think the error was caused by directly calculating loss after using 'ctlib.projection' and 'ctlib.fbp' code.

How can I solve this problem?

Question about paper implementation issue

Hi,

I saw that you opened an issue in the implementation of the paper, "CNN-based morphological decomposition of X-ray images for details and defects contrast enhancement." I trained it a few times but got terrible results.
Did you achieve good results?

Thanks,

linux系统安装问题

安装了cuda10.2 pytorch 1.7 安装此安装包时出现如下问题

image

找了很多办法都没有解决,不知道是什么原因,请问您遇到过这种情况吗?
祝好!

importError

Hi, it looks like I installed it successfully. But when I import, it shows 'ImportError: libc10.so: cannot open shared object file: No such file or directory' , Do you know why this happens? Thank you very much.

$ python setup.py install

running install
running bdist_egg
running egg_info
writing ctlib.egg-info/PKG-INFO
writing dependency_links to ctlib.egg-info/dependency_links.txt
writing top-level names to ctlib.egg-info/top_level.txt
/home/hrr/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'ctlib.egg-info/SOURCES.txt'
writing manifest file 'ctlib.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.7/ctlib.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg
creating stub loader for ctlib.cpython-37m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/ctlib.py to ctlib.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying ctlib.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ctlib.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ctlib.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ctlib.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
pycache.ctlib.cpython-37: module references file
creating 'dist/ctlib-0.2.0-py3.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing ctlib-0.2.0-py3.7-linux-x86_64.egg
removing '/home/hrr/anaconda3/envs/pytorch/lib/python3.7/site-packages/ctlib-0.2.0-py3.7-linux-x86_64.egg' (and everything under it)
creating /home/hrr/anaconda3/envs/pytorch/lib/python3.7/site-packages/ctlib-0.2.0-py3.7-linux-x86_64.egg
Extracting ctlib-0.2.0-py3.7-linux-x86_64.egg to /home/hrr/anaconda3/envs/pytorch/lib/python3.7/site-packages
ctlib 0.2.0 is already the active version in easy-install.pth

Installed /home/hrr/anaconda3/envs/pytorch/lib/python3.7/site-packages/ctlib-0.2.0-py3.7-linux-x86_64.egg
Processing dependencies for ctlib==0.2.0
Finished processing dependencies for ctlib==0.2.0

(pytorch) hrr@hzhp-Z10PE-D8-WS:~/Proj/ctlib$ python
Python 3.7.6 (default, Jan 8 2020, 19:59:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

import ctlib
Traceback (most recent call last):
File "", line 1, in
ImportError: libc10.so: cannot open shared object file: No such file or directory`

Install Error

Hi, I tried follow strictly the environment you provided, but it keeps giving me errors like this both in Windows and Linux, can you help me with the installation. I tried StackOverflow, but there is no solution I can find. Thank you very much.

Traceback (most recent call last):

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1667 in _run_ninja_build
    subprocess.run(

  File ~\anaconda3\envs\CT\lib\subprocess.py:516 in run
    raise CalledProcessError(retcode, process.args,

CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File E:\research\sparse_view_ct-main\projection_simulatuion\CTLIB\setup.py:4 in <module>
    setup(

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\__init__.py:87 in setup
    return distutils.core.setup(**attrs)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\core.py:148 in setup
    return run_commands(dist)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\core.py:163 in run_commands
    dist.run_commands()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:967 in run_commands
    self.run_command(cmd)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:74 in run
    self.do_egg_install()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:123 in do_egg_install
    self.run_command('bdist_egg')

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:165 in run
    cmd = self.call_command('install_lib', warn_dir=0)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:151 in call_command
    self.run_command(cmdname)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install_lib.py:11 in run
    self.build()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\install_lib.py:107 in build
    self.run_command('build_ext')

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:79 in run
    _build_ext.run(self)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:339 in run
    self.build_extensions()

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:708 in build_extensions
    build_ext.build_extensions(self)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:448 in build_extensions
    self._build_extensions_serial()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:473 in _build_extensions_serial
    self.build_extension(ext)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:202 in build_extension
    _build_ext.build_extension(self, ext)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:528 in build_extension
    objects = self.compiler.compile(sources,

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:681 in win_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1354 in _write_ninja_file_and_compile_objects
    _run_ninja_build(

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1683 in _run_ninja_build
    raise RuntimeError(message) from e

RuntimeError: Error compiling objects for extension

版本问题

您好 有段代码用到CTLIB库的旧版本,目前版本的与代码不适配(在fbp上),冒昧请问旧版本是否能分享安装?
Uploading IMG_3485(20221009-110709).JPG…

IMG_3486(20221009-110711)

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.