Comments (2)
Thanks for your attention, I am sorry that I just see this issue. if lowing the initial lr doesn't work. I suggest that you can try to change the activation function in the last layer of BN Mudule. I had changed the compressed sigmoid function to a linear function with limiting the output to [0.25,0.9], it seems that the NAN will no longer appear.
from iim.
Hi han tao:
I just tried a linear function, I wonder whether the parameter of the linear active function is learnable(the weight and the bias), actually, when I tried an unlearnable limitation linear function with the output value limited in [0.25,0.9] do not work, the value of the threshold appears to be too small even I magnify the threshold 1000 times.
the linear function is like this
``
class linear_limitation(nn.Module):
def init(self, para=0.75, bias=0.15):
super(linear_limitation, self).init()
#self.weight = Parameter(torch.Tensor(self.x.shape, self.x.shape))
#self.bias = Parameter(torch.Tensor(self.x.shape))
#self.reset_parameters()
def reset_parameters(self):
init.kaiming_uniform_(self.weight, a=math.sqrt(5))
if self.bias is not None:
fan_in, _ = init._calculate_fan_in_and_fan_out(self.weight)
bound = 1 / math.sqrt(fan_in)
init.uniform_(self.bias, -bound, bound)
def forward(self, x):
zero = torch.zeros_like(x)
#output = x.matmul(self.weight)+ self.bias
output = torch.where(x>0.09, zero, x)
output = torch.where(output < 0.025, zero, output)
return output
``
the threshold value before the activate function be like this
from iim.
Related Issues (20)
- 我在training時遇到以下錯誤 HOT 1
- 训练时有足够内存,依然得到out of memory问题 HOT 1
- 训练时有足够得内存,依然得到out of memory问题
- 模型保存为pt时报错RuntimeError: Could not export Python function call 'BinarizedF' HOT 1
- Great work but Threshold Encoder module is useless.Details look at the picture HOT 3
- How to visualize other datasets test set pictures? HOT 7
- 怎样转化为onnx模型 HOT 3
- RuntimeError: CUDA error: out of memory CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. HOT 1
- How to config to train on NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2 HOT 6
- Training on general dataset HOT 2
- Could you please give me demo code, I mean real-time testing code?
- Memory allocation error HOT 1
- Confidence level? HOT 8
- 主页给的HRNet权重链接hrnetv2_w48_imagenet_pretrained.pth和Crowd_locator中模型结构不太一样 HOT 1
- 请问mask_50_60具体有什么作用?运行prepare_NWPU会出现jsons文件缺失错误(缺失的是测试图片的id,所以肯定是没有的) HOT 1
- 您好 我想问下每个数据集给出的mean_std是如何计算的,和我自己计算的结果不太相同。
- segfault with pytorch 1.17 and 2.0.0 HOT 1
- FileNotFoundError: [Errno 2] No such file or directory: '../ProcessedData/JHU\\train.txt'
- input video HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iim.