WuJie1010 / Facial-Expression-Recognition.Pytorch

A CNN based pytorch implementation on facial expression recognition (FER2013 and CK+), achieving 73.112% (state-of-the-art) in FER2013 and 94.64% in CK+ dataset
MIT License
1.77k stars 546 forks source link

AttributeError: module 'utils' has no attribute 'clip_gradient' #141

Closed imKeith closed 10 months ago

imKeith commented 10 months ago

i can't figure it out.can someone help me?

imKeith commented 10 months ago

解决了

xurui123456 commented 9 months ago

解决了 怎么实现的

imKeith commented 9 months ago

这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。

imKeith commented 9 months ago

解决了 怎么实现的

把util换成作者发的那个

imKeith commented 9 months ago

是不是改过utils.py? 把改过的utils.py换成作者发的那个就OK了

xurui123456 commented 9 months ago

你有遇到过fer文件的图像处理问题嘛

xurui123456 commented 9 months ago

是不是改过utils.py? 把改过的utils.py换成作者发的那个就OK了

你有遇到过fer文件的图像处理问题嘛

imKeith commented 9 months ago

可以把问题发过来看一下吗?

xurui123456 commented 9 months ago

可以把问题发过来看一下吗?

img = img[:, :, np.newaxis] img = np.concatenate((img, img, img), axis=2) img = Image.fromarray(img)

print(type(img))

    if self.transform is not None:
        img = self.transform(img)

fer文件里的总是报错TypeError: pic should be PIL Image or ndarray. Got <class ‘torch.Tensor‘>

imKeith commented 9 months ago

可以把问题发过来看一下吗?

img = img[:, :, np.newaxis] img = np.concatenate((img, img, img), axis=2) img = Image.fromarray(img) # print(type(img)) if self.transform is not None: img = self.transform(img) fer文件里的总是报错TypeError: pic should be PIL Image or ndarray. Got <class ‘torch.Tensor‘>

我没有遇到过这种错误。 个人感觉可能需要检查transform中是否存在两次ToTensor()方法,检查transform中每一个操作的数据类型变化

imKeith commented 9 months ago

可以把问题发过来看一下吗?

img = img[:, :, np.newaxis] img = np.concatenate((img, img, img), axis=2) img = Image.fromarray(img) # print(type(img)) if self.transform is not None: img = self.transform(img) fer文件里的总是报错TypeError: pic should be PIL Image or ndarray. Got <class ‘torch.Tensor‘>

我没有遇到过这种错误。 个人感觉可能需要检查transform中是否存在两次ToTensor()方法,检查transform中每一个操作的数据类型变化

CSDN上有一个pytorch常见问题,我也是从这里面看到的