I tried many solutions, and still get the same error.
Windows 10
h5py is well installed by pip : 3.1.0
python : 3.7.2
numpy : 1.20.0
tensorflow & tensorflow-gpu version : 2.5.1
FULL error :
Traceback (most recent call last):
File “/project1/script1_callbacks”, line 22
File “C:\Users\ACTLD-17\anaconda3\envs\GPUTD78\Lib\site-packages\pixellib\semantic_init_.py”, line 49, in load_pascalvoc_model
self.model.load_weights(model_path)
File “C:\Users\ACTLD-17\anaconda3\envs\GPUTD78\Lib\site-packages\tensorflow\python\keras\engine\training.py”, line 2336, in load_weights
‘load_weights requires h5py when loading weights from HDF5.’)
ImportError: load_weights requires h5py when loading weights from HDF5.
the code blocks at this line :
segment_image.load_pascalvoc_model(‘C:\Users\…\deeplabv3_xception_tf_dim_ordering_tf_kernels.h5’)
ps : the same code & TD project runs very well on my macbook pro, no issues with same packages & python version
What TouchDesigner version are you trying to load the library into ?
Is the Python AI/ML project you are trying to run available in Github or somewhere for me to give it a try? Or is it some code you wrote yourself, relying on Tensorflow / Keras as far as I can tell ?
I’m having a similar issue using a training script with tensorflow. I tried installing h5py and including an ‘import h5py’ in the script but now I get:
“ImportError: DLL load failed while importing defs: The specified procedure could not be found.”
Also using the Anaconda virtual environment (python 3.9.7) with the latest TD (experimental build) in order to make sure the DLL load script (from the Anaconda+TD tutorial) works.
ImportError: load_weights requires h5py when loading weights from HDF5.
Seem to be a version / conflict issue somewhere. It’s documented in google such as here.
However, not much luck getting it working either at the moment, I’ve been encountering the same issue “ImportError: DLL load failed while importing defs: The specified procedure could not be found.”.
@pdavila Note that your python version should preferably be 3.9.5
If this is an emergency, I’d suggest using those scripts outside of TouchDesigner for now and sending the data from / to a standalone Python process using OSC and / or Spout.
I’m actualy doing the detection job outside TD, i save each frame as png and open it into TD script by cv2.imread() it’s working but it create some glitch and latency
Hey @JetXS any progress with this bug?
I’m having a very similar error with a ML setup I’m working on.
Everything works fine as external application, but when inside of TD it gives this error:
Traceback (most recent call last):
File "/project1/script4_callbacks", line 17
File "C:\Users/dsant/AppData/Local/Programs/Python/Python39/Lib/site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users/dsant/AppData/Local/Programs/Python/Python39/Lib/site-packages\keras\utils\traceback_utils.py", line 64, in error_handler
return fn(*args, **kwargs)
File "C:\Users/dsant/AppData/Local/Programs/Python/Python39/Lib/site-packages\keras\saving\save.py", line 212, in load_model
raise ImportError(
ImportError: Filepath looks like a hdf5 file but h5py is not available. filepath=C:/Users/dsant/Desktop/emotion_detection_model_100epochs.h5
Quick update: I’ve been looking into the h5py issue and I think it’s a compatibility issue between the hdf5 libraries that are already included with TouchDesigner and the ones that the h5py module is looking for.
I’m not sure yet on a solution that will work for everything, but we’ll let you know what we find.
In the next build we release I’ve removed our dependency on HDF5 and we no longer ship with it, so the one you are trying to use should be picked up now. Thanks for the report.
This was tested internally by importing h5py and loading the deeplabv3_xception_tf_dim_ordering_tf_kernels.h5 model, that the original poster “pixellib” is relying on, in a tensorflow-gpu environment.