Closed zhouqp631 closed 3 years ago
Can you give me the full output of examples/fbp.py
I think it should print "Importing exception"
The installation is all right, I do not know why occer Importing exception
$ python fbp.py Importing exception Importing exception Traceback (most recent call last): File "fbp.py", line 16, in
radon = Radon(image_size, angles, clip_to_circle=True) File "/public/home/hpc220115/.conda/envs/dlenv/lib/python3.6/site-packages/torch_radon/init.py", line 169, in init rays_cfg = RaysCfg(resolution, resolution, det_count, det_spacing, len(angles), clip_to_circle) NameError: name 'RaysCfg' is not defined Exception ignored in: <bound method BaseRadon.del of <torch_radon.Radon object at 0x2ae8005392b0>> Traceback (most recent call last): File "/public/home/hpc220115/.conda/envs/dlenv/lib/python3.6/site-packages/torch_radon/init.py", line 140, in del self.noise_generator.free() AttributeError: 'Radon' object has no attribute 'noise_generator'
There is a problem in doing import torch_radon_cuda
. Can you try running python
and then import torch
and import torch_radon_cuda
?
Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torch_radon_cuda
>>>
Try running python
and then import torch
and from torch_radon_cuda import RaysCfg
?
>>> import torch
>>> from torch_radon_cuda import RayCfg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'RayCfg' from 'torch_radon_cuda'
(/public/home/*/.conda/envs/py38/lib/python3.8/site-packages/torch_radon-1.0.0-py3.8-
linux-x86_64.egg/torch_radon_cuda.cpython-38-x86_64-linux-gnu.so)
I don't know why it is trying to import the Python 3.8 library while you are using python 3.6.
Let's try to reinstall the library with pip install --force-reinstall --no-cache-dir https://rosh-public.s3-eu-west-1.amazonaws.com/radon/cuda-10.1/torch-1.7/torch_radon-1.0.0-cp36-cp36m-linux_x86_64.whl
sorry I mix up the environment. I test different python version for the installation. Now I reinstall packages with your code, and get error information like
Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> from torch_radon_cuda import RayCfg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /public/home/*/.conda/envs/dlenv/lib/python3.6/site-packages/torch_radon_cuda.cpython-36m-x86_64-linux-gnu.so)
The problem is that your system has an old version of the GNU C library and TorchRadon is linked against a newer version. In order to check this you can run ldd --version
and you should get a version < 2.27.
I thought that this problem was fixed with the changes I have made in order to solve #5 but I was wrong. I will try to find a solution to this problem in the next few days and let you know as soon as I solve it.
In the meantime you can consider using TorchRadon inside a Docker container or you can compile the library from source.
Many thanks. I do get version<2.27 using ldd --version
.
I want to install TorchRadon in HPC, but I can not update GNU C for I do not have the authority. So, I'll try Docker container.
Can you please tell me the version you get using ldd --version
?
(base) [*@gpu208 ~]$ ldd --version
ldd (GNU libc) 2.17
By the way, could you tell me how to compile the TorchRadon with specified version of gcc and glibc?
TorchRadon itself doesn't need a very new version of gcc or glibc, the problem is that precompiled binaries are linked against a modern version of glibc and this creates incompatibilities with "old" distributions of Linux.
I have changed the compilation in the branch "v2" where I am working on a new version of TorchRadon it's a work in progress but you can use the functions of the previous version without any problem. You can install the new version by running:
wget -qO- https://raw.githubusercontent.com/matteo-ronchetti/torch-radon/v2/auto_install.py | python -
Otherwise it is possible to put a new version of GLIB in your home directory and make Python use that instead of the system glib. If even the new version has problems with glib I will write a tutorial on how to do it.
I have successfully installed the new version 'v2' and it works well. Thanks for your timely reply!
Hi,
The package is installed correctly, but it is not working. There is
name 'RaysCfg' is not defined
error, how can i fix it?Thanks!
installation
when I test 'examples/fbp.py', error shows