jiaoyining / cuRadiomics

Extracting Radiomic Features using CUDA for GPU-acceleration
21 stars 4 forks source link

A Bug:"tensorflow.python.framework.errors_impl.NotFoundError: .\build\libRadiomics.so not found" #1

Open YutingHe-list opened 4 years ago

YutingHe-list commented 4 years ago

There is a bug:" tensorflow.python.framework.errors_impl.NotFoundError: .\build\libRadiomics.so not found". I have tried to modify the path, but the bug is still here. Can you help me?

jiaoyining commented 4 years ago

There is a bug:" tensorflow.python.framework.errors_impl.NotFoundError: .\build\libRadiomics.so not found". I have tried to modify the path, but the bug is still here. Can you help me?

Hi Yuting, Sorry for the late reply. Could you please show me the organization of your project and you source code when calling the '.so' file for my better understanding the problem? Thx. Yining

RivettiLuciano commented 4 years ago

Hi, I had the same problem when running the demo.py. I just downloaded the entire set of file and run the demo.

The error is :

File "/home/luciano/Desktop/CuRadiomics/cuRadiomics-master/python/demo.py", line 16, in features = func_cuRadiomics(yaml_addr, arr_img, arr_msk) File "/home/luciano/Desktop/CuRadiomics/cuRadiomics-master/python/func_cuRadiomics.py", line 13, in func_cuRadiomics _RadiomicsGLCMModule = tf.load_op_library('./build/libRadiomics.so').radiomics File "/home/luciano/anaconda3/envs/ImgPro/lib/python3.7/site-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library lib_handle = py_tf.TF_LoadLibrary(library_filename) tensorflow.python.framework.errors_impl.NotFoundError: ./build/libRadiomics.so: cannot open shared object file: No such file or directory.

jiaoyining commented 4 years ago

@YutingHe-list @RivettiLuciano Hi, I think there are some points that may be helpful for both of you.

First, whether the path of the .so file exists and is used correctly. This can be validated with os.path.exist(the path of .so file) Second, if the path is correctly quoted, there may be some problems of tensorflow installation. Because C++ tensorflow API is used in the CUDA code, I installed C++ tensorflow 1.12.0 (https://www.jianshu.com/p/3d925fe9c3cb). Third, through the experience of others' using cuRadiomics, the python tensorflow should be installed by conda install, but not pip install.

RivettiLuciano commented 4 years ago

I'm using python 1.7 and I have an NVIDIA GPU.

1- The the file .so exist and the directory is correct. 2- The path is correctly quoted. I dont understand really well what do you mean with this "I installed C++ tensorflow 1.12.0" 3- I installed the tensorflow with conda. I have the version 1.14.0

The problem is still there.

Thank you, Luciano.

jiaoyining commented 4 years ago

@RivettiLuciano

There might be something wrong with your libtensorflow_framework.so. Specifically,

  1. Do you have it in your "/home/luciano/anaconda3/envs/ImgPro/lib/python3.7/site-packages/tensorflow/" directory? Currently I am not sure whether we have the same thing in the anaconda tf directory.
  2. The libRadiomics.so is generated with some C and CUDA code in the src directory, in which tensorflow C++ api (1.12.0 version) is called. Therefore, if you use tensorflow1.14.0 and called its tf.load_op_library(), the libtensorflow_framework.so of tf1.14.0, instead of tf1.12.0, would be called to read the libRadiomics.so. Inconsistences of libtensorflow_framework.so might trigger some problems.
RivettiLuciano commented 4 years ago

I create a new environment with a python 3.6 and installed Tensorflow 1.12.0 and it still doesn't work. The error is the same of with python 3.7 and tensorflow 1.14.0.

Screenshot from 2020-08-12 09-13-31 - 1

jiaoyining commented 4 years ago

@RivettiLuciano Do you have libtensorflow_framework.so in your "/home/luciano/anaconda3/envs/ImgPro/lib/python3.7/site-packages/tensorflow/" directory?

jiaoyining commented 4 years ago

@RivettiLuciano

The bug log you provided says that the libtensorflow_framework.so could not be called.

RivettiLuciano commented 4 years ago

Yeah. I would like to tell what I did. I just download the code that you upload and tried to run the demo.py. Did I have to do something else before?

Screenshot from 2020-08-12 09-19-50

jiaoyining commented 4 years ago

@RivettiLuciano

I think yes. Your problem is quite common because when tf.load_op_library() is called, the C++ tensorflow api will be called. I have seen many people who cannot call this function and report their bugs, here is an example (https://github.com/tensorflow/tensorflow/issues/30488). I think it may be kind of similar to yours.

The point is that if your compiler cannot find libtensorflow_framework.so file, or cannot match the .so file with our generated libRadiomics.so file, errors would be triggered. In my case, I installed C++ tensorflow 1.12.0 API (https://www.jianshu.com/p/3d925fe9c3cb), because this is used when I generated the libRadiomics.so. And all C++ tensorflow 1.12.0 API would be given to the default environment path so I don't need to worry about the aforementioned problem.

And I think you can try two choices.

  1. change the environment path, you can refer to https://github.com/tensorflow/tensorflow/issues/30488.
  2. install C++ tensorflow 1.12.0 API (this may be a little time-comsuming)
FazalUrRehmanFaisal commented 3 years ago

Hi, I tried to run your code as per the steps you mention in your Github. However, I find some errors while running the code. Kindly, guide me on how can I resolve this issue.

Traceback (most recent call last): File "/home/fazal_dmcl/PycharmProjects/cudamics/demo.py", line 5, in from python.func_cuRadiomics import func_cuRadiomics File "/home/fazal_dmcl/PycharmProjects/cudamics/python/func_cuRadiomics.py", line 4, in from ToolsFunc import * ModuleNotFoundError: No module named 'ToolsFunc'

jiaoyining commented 3 years ago

@FazalUrRehmanFaisal Updated. Please try again. Thanks!

FazalUrRehmanFaisal commented 3 years ago

@jiaoyining thanks for the update. I tried to run it again this time I'm getting this error:

ModuleNotFoundError: No module named 'radiomics'

I tried to install it using: conda install -c radiomics pyradiomics

Also I follow this website to install it : https://pyradiomics.readthedocs.io/en/latest/installation.html

But the error is still there,

I would be thankful to you to resolve this issue. Thanks

I'm using it on Jupyter Notebook. Python 3.7

jiaoyining commented 3 years ago

@FazalUrRehmanFaisal I suggest you can install from source. 1. git clone git://github.com/Radiomics/pyradiomics 2. cd pyradiomics python -m pip install -r requirements.txt python setup.py install

FazalUrRehmanFaisal commented 3 years ago

@jiaoyining Sorry for late response.

I tried this method on my ubuntu 20.04 environment but it's not working.

I also tried it to implement using Jupyter notebook but i'm still getting this error.

error