0

libtensorflow_io.so not found

I am using an x86, windows 11 setup. Python 3.11, tensorflow-io==0.31.0

This is the code I have been trying to run so far:

import os
from matplotlib import pyplot as plt
import tensorflow as tf
import tensorflow_io as tfio

CAPUCHIN_FILE = os.path.join('data','Parsed_Capuchinbird_Clips','XC3776-3.wav')
NOT_CAPUCHIN_FILE = os.path.join('data','Parsed_Not_Capuchinbird_Clips','afternoon-birds-song-in-forest-0.wav')


def load_wav_16k_mono(filename):
    #Load encoded wav file
    file_contents=tf.io.read_file(filename)
    #decode wav(tensors by channels)
    wav,sample_rate=tf.audio.decode_wav(file_contents,desired_channels=1)
    #removes trailing axis
    wav=tf.squeeze(wav,axis=-1)
    sample_rate=tf.cast(sample_rate,dtype=tf.int64)
    #Goes from 44100Hz 6o 16000hz - amplitude of the audio signal
    wav = tfio.audio.resample(wav,rate_in=sample_rate,rate_out=16000)
    return wav

wave = load_wav_16k_mono(CAPUCHIN_FILE)
nwave = load_wav_16k_mono(NOT_CAPUCHIN_FILE)

The error I receive is:

NotImplementedError: unable to open file: libtensorflow_io.so, from paths: ['C:\Users\bchai\PycharmProjects\AudioML\venv\Lib\site-packages\tensorflow_io\python\ops\libtensorflow_io.so']
caused by: ['C:\Users\bchai\PycharmProjects\AudioML\venv\Lib\site-packages\tensorflow_io\python\ops\libtensorflow_io.so not found']

I tried downgrading tensorflow-io to 0.30.0 that did not help either.

The results posted online for this issue involve installation of tensorflow-io version 0.23.1 but for python 3.11, it says distribution not found.

I thought of installing a >= 3.7 version of python, but those are not available in downloads at python.org.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • https://stackoverflow.com/questions/65623468/unable-to-open-file-libtensorflow-io-so-caused-by-undefined-symbol – darth baba May 20 '23 at 20:26

1 Answers1

0

There is python version conflicts. Tensorflow-io latest version 0.32.0 requires python >=3.7 and <3.11.

Please try again by downgrading the python version to 3.10 and install tensorflow 2.11 as mentioned in this TensorFlow Version Compatibility for installing tensorflow-io.

Please check this below screenshot for your reference:

enter image description here

TF_Renu Patel
  • 356
  • 1
  • 4