Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error #2

Closed
zhixwang opened this issue Jan 2, 2023 · 3 comments
Closed

Runtime Error #2

zhixwang opened this issue Jan 2, 2023 · 3 comments

Comments

@zhixwang
Copy link

zhixwang commented Jan 2, 2023

Hi Authors, thanks for the work. I am trying to run the example using python .\neural_ilt.py, but I got the following error information:

RuntimeError: Cannot initialize CUDA without ATen_cuda library. PyTorch splits its backend into two shared libraries: a CPU library and a CUDA library; this error has occurred because you are trying to use some CUDA functionality, but the CUDA library has not been loaded by the dynamic linker for some reason. The CUDA library MUST be loaded, EVEN IF you don't directly use any symbols from the CUDA library! One common culprit is a lack of -INCLUDE:?warp_size@cuda@at@@yahxz in your link arguments; many dynamic linkers will delete dynamic library dependencies if you don't depend on any of their symbols. You can check if this has occurred by using link on your binary to see if there is a dependency on *_cuda.dll library.

My environment (Win64, anaconda, 3090-Ti) is as follows:

blas                      1.0                         mkl
ca-certificates           2022.12.7            h5b45459_0    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cudatoolkit               11.1.1              heb2d755_10    conda-forge
eigen                     3.3.7                h59b6b97_1
glib                      2.69.1               h5dc1a3c_2
gst-plugins-base          1.18.5               h9e645db_0
gstreamer                 1.18.5               hd78058f_0
hdf5                      1.12.1               h1756f20_2
icc_rt                    2022.1.0             h6049295_2
icu                       58.2                 ha925a31_3
intel-openmp              2021.4.0          haa95532_3556
jpeg                      9e                   h2bbff1b_0
lerc                      3.0                  hd77b12b_0
libclang                  12.0.0          default_h627e005_2
libdeflate                1.8                  h2bbff1b_5
libffi                    3.4.2                hd77b12b_6
libiconv                  1.16                 h2bbff1b_2
libogg                    1.3.5                h2bbff1b_1
libpng                    1.6.37               h2a8f88b_0
libprotobuf               3.20.1               h23ce68f_0
libtiff                   4.4.0                h8a3f274_2
libvorbis                 1.3.7                he774522_0
libwebp                   1.2.4                h2bbff1b_0
libwebp-base              1.2.4                h2bbff1b_0
libxml2                   2.9.14               h0ad7f3c_0
libxslt                   1.1.35               h2bbff1b_0
lz4-c                     1.9.4                h2bbff1b_0
mkl                       2021.4.0           haa95532_640
mkl-service               2.4.0            py37h2bbff1b_0
mkl_fft                   1.3.1            py37h277e83a_0
mkl_random                1.2.2            py37hf11a4ad_0
numpy                     1.21.5           py37h7a0a035_3
numpy-base                1.21.5           py37hca35cd5_3
opencv                    4.6.0            py37h104de81_2
opencv-python             4.7.0.68                 pypi_0    pypi
openssl                   1.1.1s               h2bbff1b_0
pcre                      8.45                 hd77b12b_0
pillow                    6.1.0                    pypi_0    pypi
pip                       22.3.1           py37haa95532_0
python                    3.7.3                h8c8aaf0_1
qt-main                   5.15.2               he8e5bd7_7
qt-webengine              5.15.9               hb9a9bb5_4
qtwebkit                  5.212                h3ad3cdb_4
setuptools                65.5.0           py37haa95532_0
six                       1.16.0             pyhd3eb1b0_1
sqlite                    3.40.0               h2bbff1b_0
torch                     1.8.0                    pypi_0    pypi
torchvision               0.2.2                    pypi_0    pypi
tqdm                      4.19.9                   pypi_0    pypi
typing-extensions         4.4.0                    pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
wincertstore              0.2              py37haa95532_2
xz                        5.2.8                h8cc25b3_0
zlib                      1.2.13               h8cc25b3_0
zstd                      1.5.2                h19a0ad4_0

Is there any reason for the error? Thanks!

@InfamousMeGa
Copy link
Member

InfamousMeGa commented Jan 2, 2023

Hi zhixwang,

Sorry that we have never met this issue before. According to the error information, seems like the CUDA libs on your Windows machine are either not correctly installed or not compatible with neural-ilt.

My general suggestion is to prepare and test Neural-ilt on a linux machine with CUDA correctly installed. FYI, the code in this repo can be run on our side with the following evn setups:
Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-158-generic x86_64)
CUDA Version: 11.4

Thanks!

@zhixwang
Copy link
Author

zhixwang commented Jan 25, 2023

Hi authors, could you please also share the version of cv2(opencv) library for the repo?

I tried to run python neural_ilt.py and got the following error info:

Namespace(beta=1.45, gpu_no=0, load_model_name='iccad_32nm_m1_wts.pth', select_by_obj=True)
Launching Neural-ILT on device: cuda:0
-------- Loading Neural-ILT Model & Data --------
MODEL: models/unet/iccad_32nm_m1_wts.pth
DATASET: ICCAD2013-IBM-Benchmark

Processing t1_0_mask.png with size of (245, 291, 1537, 1583) and scale factor = [2.5234375, 2.5234375]

--- Initializing Model for t1_0_mask.png ---
Traceback (most recent call last):
  File "neural_ilt.py", line 436, in <module>
    run_neural_ilt_ibm_bench()
  File "neural_ilt.py", line 356, in run_neural_ilt_ibm_bench
    l2_avg, pv_avg, epe_avg, runtime_avg = nerual_ilt.neural_ilt_correction(refine_data_loader)
  File "neural_ilt.py", line 185, in neural_ilt_correction
    inputs, labels, new_cord
  File "/root/anaconda3/envs/nilt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/neural-ilt/neural_ilt_backbone.py", line 104, in forward
    out_loss = self.ilt_loss_layer(x, y, new_cord)
  File "/root/anaconda3/envs/nilt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/root/neural-ilt/ilt_loss_layer.py", line 164, in forward
    return ilt_loss_scale_function.apply(preds, target, self.kernels, self.kernels_ct, self.kernel_def, self.kernel_def_ct, self.weight, self.weight_def,new_cord, self.cycle_mode, self.cplx_obj, self.report_epe)
  File "/root/neural-ilt/ilt_loss_layer.py", line 116, in forward
    checkpoints = get_epe_checkpoints((target.detach().data.cpu().numpy()[0][0] * 255).astype(np.uint8))
  File "/root/neural-ilt/utils/epe_checker.py", line 64, in get_epe_checkpoints
    polys, _ = find_all_contours(layout)
  File "/root/neural-ilt/utils/epe_checker.py", line 16, in find_all_contours
    cnts, hier = cv.findContours(gray_img, cv.RETR_TREE, contour_approx)
ValueError: too many values to unpack (expected 2)

I am running the code on a Linux machine with GPU. All the packages are installed with the correct version as required by the repo, except for opencv which is the default version (3.4.2). I suspect that this error might be caused by a wrong version of opencv library.

Thanks!

@zhixwang
Copy link
Author

I managed to run the repo with opencv=4.3.0.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants