报错:
AttributeError: 'numpy.ndarray' object has no attribute 'cpu'
代码片段:
for file in file_list:
features = np.load(file.strip('\n'), allow_pickle=True)
features = [t.cpu().detach().numpy() for t in features] # 出错行
features = np.array(features, dtype=np.float32)
num_frame = features.shape[0] * 16
控制变量法,一个个删掉报错项后相继报错
AttributeError: 'numpy.ndarray' object has no attribute 'detach'
AttributeError: 'numpy.ndarray' object has no attribute 'numpy'
感谢大家!