报错AttributeError: numpy.ndarray object has no attribute dim
完整报错信息:if input.dim() == 2 and bias is not None: AttributeError: ‘numpy.ndarray’ object has no attribute ‘dim’出错代码:是因为上述代码中mix_amplitude_log_batch_con为ndarry类型,故需要改成如下所示:将mix_amplitude_log_batch_con改为Tensor类型后,错误消失!问题出处:训练好模型后,在开始进行测试阶段,将测试数据放入模型中测试时