DehazeNet_Pytorch
DehazeNet_Pytorch copied to clipboard
AttributeError: module 'torch.nn' has no attribute 'BReLU'
When I run the train() function, I get this error. There is a comment in the file DehazeNet-pytorch.py:
BRelu used for GPU. Need to add that reference in pytorch source file.
I don't quite understand what it means, whether it caused the problem? Please help, I would be grateful.
torch.nn里没有BReLU这个激活函数,要把作者自己写的BReLU添加到PyTorch源文件里
你好 如果是自己实验的话 可以修改源文件,在ReLU的源文件里自己写一个,仿照ReLU来写,开头加上BReLU的引用 或者你可以直接换一个激活函数
发自我的iPhone
------------------ Original ------------------ From: Scotty1027 <[email protected]> Date: Fri,Nov 6,2020 6:45 PM To: thuBingo/DehazeNet_Pytorch <[email protected]> Cc: Subscribed <[email protected]> Subject: Re: [thuBingo/DehazeNet_Pytorch] AttributeError: module 'torch.nn' has no attribute 'BReLU' (#1)
torch.nn里没有BReLU这个激活函数
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@Scotty1027 `@weak_module class BReLU(Hardtanh): def init(self, inplace=False): super(BReLU, self).init(0., 1., inplace)
def extra_repr(self):
inplace_str = 'inplace=True' if self.inplace else ''
return inplace_str`
我在activation.py中修改了源码,可是依然报错,请问是什么原因?
@Scotty1027 `@weak_module class BReLU(Hardtanh): def init(self, inplace=False): super(BReLU, self).init(0., 1., inplace)
def extra_repr(self): inplace_str = 'inplace=True' if self.inplace else '' return inplace_str`
我在activation.py中修改了源码,可是依然报错,请问是什么原因?
你可以发一下你的报错内容;
或者直接调用原作者定义的BReLU(),不去修改activation.py
你好,想咨询一下怎么在pytorch 源文件中修改?或者说具体是哪个代码文件中修改呢?总感觉现在的代码不是很完整,少了一些东西。
我没有修改pytorch的源文件,而是直接调用了作者写的BReLU()到网络中,具体如图
@XinzheGeng 请问有没有发现测试图像都偏黑,准确说是特别黑