shufflenet implement by mxnet gluon. By Marks.
- model.py: Define the model, which consists of features and output.
- utils:
- dataAugmentation.py: Image augmentation operaters.
- dataLoder.py: Data iter, which for classify, segmentation, detection, etl.
shufflenet implement by mxnet gluon.
定义:def channel_shuffle(data, groups):
data = mx.sym.reshape(data, shape=(0, -4, groups, -1, -2))
data = mx.sym.swapaxes(data, 1, 2)
data = mx.sym.reshape(data, shape=(0, -3, -2))
return data
测试数据:blk = Shufflenetv2(3)
blk.initialize()
x = nd.random.uniform(shape=(4, 3, 6, 6))
blk(x).shape
问题:AssertionError Traceback (most recent call last)
in ()
2 blk.initialize()
3 x = nd.random.uniform(shape=(4, 3, 6, 6))
----> 4 blk(x).shape
D:\anaconda\envs\gluon\lib\site-packages\mxnet\gluon\block.py in call(self, *args)
411 def call(self, *args):
412 """Calls forward. Only accepts positional arguments."""
--> 413 return self.forward(*args)
414
415 def forward(self, *args):
in forward(self, x)
48
49 x = nd.concat(x_left,x_right, dim=1)
---> 50 x = channel_shuffle(x,2)
51 return x
in channel_shuffle(data, groups)
1 def channel_shuffle(data, groups):
----> 2 data = mx.sym.reshape(data, shape=(0, -4, groups, -1, -2))
3 data = mx.sym.swapaxes(data, 1, 2)
4 data = mx.sym.reshape(data, shape=(0, -3, -2))
5 return data
D:\anaconda\envs\gluon\lib\site-packages\mxnet\symbol\register.py in reshape(data, shape, reverse, target_shape, keep_highest, name, attr, out, **kwargs)
AssertionError: Argument data must be Symbol instances, but got
[[[[ 6.13965929e-01 6.79090619e-01 5.35632789e-01 8.64281416e-01
5.89909971e-01 7.50844240e-01]
提问:请问这是因为我的测试数据是随机生成的自然数的原因吗?您有遇到过相关问题吗?谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.