问1:mp3_to_pkl.py
? audioread.exceptions.NoBackendError
? Error opening ‘160379207_4.mp3’:File contains data in an unknown format.
解决1:1.pip uninstall librosa
? pip install librosa==0.6.1
? 2.windows下解决librosa NoBackendError问题
? conda install ffmpeg -c conda-forge
问2:把pkl文件从audio移动到pickle文件夹中
解决2:python代码如下:
import os
import glob
import shutil
from tqdm import tqdm
def remove(pklfile):
file_list = os.listdir(pklfile)
pfile = pklfile[:-6]
for item in file_list:
newfile = os.path.join(os.path.abspath(pfile), 'pickle')
if os.path.exists(newfile):
print('exists')
else:
os.mkdir(newfile)
if item.endswith('.pkl'):
src = os.path.join(os.path.abspath(pklfile), item)
dst = os.path.join(os.path.abspath(newfile), item)
shutil.move(src,dst)
arg = 'E://Work/dataset/test'
mfile = os.path.join(arg, 'audio' if 'drive' in arg else '*/audio', )
mp3_files = glob.glob(mfile)
for pklfile in tqdm(mp3_files):
remove(pklfile)
pip install google…
vim
进入编辑模式:i
退出编辑模式:esc
保存并退出: :wq
报错:‘ModelWithNMSLossAugmented’ object has no attribute ‘module’:
解决:改代码 src/optimization/traditional.py
model.teacher_models.eval()
model.student_model.train()
问题:由于pkl文件存在pickle文件夹中因此需对代码进行修改
解决:/src/dataset/MultimodalDetection—line 167
audio_paths = [os.path.join(
self.data_path,
drive,
"pickle",
f"audio_{i}_{rgb_timestamp}.pkl"
) for i in range(8)]
问题:![img](file:///C:\Users\Documents\Tencent Files\1270152017\Image\C2C~X168]$V63Z$MRW~Z@K5PQA.png)
解决:改代码 src/dataset/MultimodalDetection.py -----line 251
audio = np.transpose(np.array(audio, dtype=np.float32), (2, 0, 1))
问题:UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0x80 in position 0: illegal multibyte sequence
解决:, encoding=‘UTF-8’
|