Comments (6)
我觉得是不是在每一个网络层里面width_mult而不是self.width_mult
from mutualnet.
@yangzhaojason Hi, which line are you refering to?
from mutualnet.
class USConv2d(nn.Conv2d):
def init(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1, groups=1, depthwise=False, bias=True,
us=[True, True], ratio=[1, 1]):
in_channels_max = in_channels
out_channels_max = out_channels
if us[0]:
in_channels_max = int(make_divisible(
in_channels
* width_mult
/ ratio[0]) * ratio[0])
if us[1]:
out_channels_max = int(make_divisible(
out_channels
* width_mult
/ ratio[1]) * ratio[1])
groups = in_channels_max if depthwise else 1
super(USConv2d, self).init(
in_channels_max, out_channels_max,
kernel_size, stride=stride, padding=padding, dilation=dilation,
groups=groups, bias=bias)
self.depthwise = depthwise
self.in_channels_basic = in_channels
self.out_channels_basic = out_channels
self.width_mult = None
self.us = us
self.ratio = ratio
def forward(self, input):
in_channels = self.in_channels_basic
out_channels = self.out_channels_basic
if self.us[0]:
in_channels = int(make_divisible(
self.in_channels_basic
* self.width_mult
/ self.ratio[0]) * self.ratio[0])
if self.us[1]:
out_channels = int(make_divisible(
self.out_channels_basic
* self.width_mult
/ self.ratio[1]) * self.ratio[1])
self.groups = in_channels if self.depthwise else 1
weight = self.weight[:out_channels, :in_channels, :, :]
if self.bias is not None:
bias = self.bias[:out_channels]
else:
bias = self.bias
y = nn.functional.conv2d(
input, weight, bias, self.stride, self.padding,
self.dilation, self.groups)
if getattr(FLAGS, 'conv_averaged', False):
y = y * (max(self.in_channels_list)/self.in_channels)
return y
from mutualnet.
上面代码里面,self.width_mult 你是通过model.apply初始化的,但是很遗憾,我这边没有成功。我在forward的时候,打印了self.width_mult依然为None
from mutualnet.
@yangzhaojason Hi, it works normally on my side. Are you able to run the training? Since if it is None when you do the forward, it should throw out an error.
from mutualnet.
感谢,问题已经解决
from mutualnet.
Related Issues (13)
- coco上的检测训练代码,方便公布下么? HOT 1
- 大佬,请问能够上传一份预训练模型到百度云吗? HOT 2
- Error caught during inference HOT 6
- 训练train.py中“print training log”为什么还要进行model预测? HOT 1
- AttributeError: Can't pickle local object 'get_cifar.<locals>.<lambda>' HOT 2
- model(input_list[random.randint(0, 3)]),每一次输入训练的input_list.shape是多大? HOT 6
- How to implement dynamic inference on MutualNet HOT 5
- Test with validation data? HOT 2
- detection code HOT 2
- test acc is 0 HOT 2
- 请问BN层中momentum这个为什么是分数衰减的 HOT 3
- Accuracy-FLOPs curves of MutualNet and US-Net
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 mutualnet.