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

Exception: Cannot load CDF C library; checked . Try 'os.environ["CDF_LIB"] = library_directory' before import. #206

Closed
YuktiADY opened this issue Jan 3, 2023 · 6 comments

Comments

@YuktiADY
Copy link

YuktiADY commented Jan 3, 2023

Hi,

I am trying to train the model on my custom dataset but while running ths script i get the below error:

I have already installed cdflib as per given in the repo but still error persists.

Traceback (most recent call last):
File "src/predict_3dpose.py", line 13, in
import data_utils
File "/home//src/data_utils.py", line 9, in
import xml_to_dataframe
File "/home/src/xml_to_dataframe.py", line 9, in
from spacepy import pycdf
File "/home//anaconda3/envs/3d-pose/lib/python3.6/site-packages/spacepy/pycdf/init.py", line 1303, in
'before import.').format(', '.join(_libpath)))
Exception: Cannot load CDF C library; checked . Try 'os.environ["CDF_LIB"] = library_directory' before import.

I even trying seeting the library path 👍

import os
os.environ["CDF_LIB"] = "/home/yukti/anaconda3/envs/3d-pose/lib/python3.6/site-packages/cdflib"
from spacepy import pycdf
Still error persists.
Please suggest if i missed something.

@una-dinosauria
Copy link
Owner

os.environ["CDF_LIB"] = "/home/yukti/anaconda3/envs/3d-pose/lib/python3.6/site-packages/cdflib"

That looks like the path to the python wrapper of CDF. Try installing the library from https://cdf.gsfc.nasa.gov/

@YuktiADY
Copy link
Author

YuktiADY commented Jan 3, 2023

This is where cdf is installed .
There is one folder named 'cdflib-0.4.9.dist-info' .. Is this the correct one ?
I installed cdf using pip as per the repo instructions.

pip install cdflib

@una-dinosauria
Copy link
Owner

Actually I'm not sure why you're seeing that error.

Traceback (most recent call last):
File "src/predict_3dpose.py", line 13, in
import data_utils
File "/home//src/data_utils.py", line 9, in
import xml_to_dataframe
...

Line 9 of src/data_utils.py does not have import xml_to_dataframe

Please only open issues to ask questions about the code in this repo, not about changes that you have made locally, or code that you obtained elsewhere.

@YuktiADY
Copy link
Author

YuktiADY commented Jan 3, 2023

Actually I'm not sure why you're seeing that error.

Traceback (most recent call last):
File "src/predict_3dpose.py", line 13, in
import data_utils
File "/home//src/data_utils.py", line 9, in
import xml_to_dataframe
...

Line 9 of src/data_utils.py does not have import xml_to_dataframe

Please only open issues to ask questions about the code in this repo, not about changes that you have made locally, or code that you obtained elsewhere.

I have checked it has. The problem is CDF library. It is not able to read the CDF library.

as per repo i installed cdf using
pip install cdflib . but i get this error.

Please suggest.

@una-dinosauria
Copy link
Owner

Like I said, you are working with some old version of this code, or you are using code from somewhere else:

import cdflib
import numpy as np
import cameras
# Human3.6m IDs for training and testing
TRAIN_SUBJECTS = [1,5,6,7,8]
TEST_SUBJECTS = [9,11]

No spacepy or xml_to_dataframe is to be found on the code of this repository. Double check what you have downloaded and try again -- I am muting this thread

@YuktiADY
Copy link
Author

YuktiADY commented Jan 3, 2023

No I am using code of this repo only as i am training on my custom dataset so the dataset is in xml which is then converted using pandas.

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