Open Belegkarnil opened 4 years ago
Hi, as pointed out by @chrishkchris , the convention is to use RELU as stateless layer. usage: https://github.com/apache/singa/blob/master/examples/cnn/model/cnn.py#L40
For shape mismatch, you might need to check the shape of layers again. Let me know if further info is required.
Ok, I'll try but why to provide a statefull ReLU Layer? Is it for a specific purpose?
I compared my implementation to other frameworks and it is the same shapes. Moreover the forward pass does not cause any issue, it is the backward pass. This is why I suspect a bug. Is it possible?
Hi, as pointed out by @chrishkchris , the convention is to use RELU as stateless layer. usage: https://github.com/apache/singa/blob/master/examples/cnn/model/cnn.py#L40
For shape mismatch, you might need to check the shape of layers again. Let me know if further info is required.
@dcslin Did you try to run the code pasted by @Belegkarnil ? Can you reproduce the error?
Hi, as pointed out by @chrishkchris , the convention is to use RELU as stateless layer. usage: https://github.com/apache/singa/blob/master/examples/cnn/model/cnn.py#L40 For shape mismatch, you might need to check the shape of layers again. Let me know if further info is required.
@dcslin Did you try to run the code pasted by @Belegkarnil ? Can you reproduce the error?
I am still checking the code
Hi @Belegkarnil, you might need to change 256 6 6, 4096 to 256, 4096 to make it works.
Also you are recommended to use relu/dropout/flatten like this https://github.com/apache/singa/blob/master/examples/cnn/model/cnn.py#L40
Ok thanks a lot ! I assumed that it works like other frameworks but that the result of AvgPool has a different shape.
Hi,
I have implemented AlexNet in singa but I obtain an error during the backward_and_update instruction. I am using Singa 3.0.0.rc1 on cpu.
This is my AlexNet implementation: `from singa import autograd from singa import module from singa import opt
all = ['AlexNet', 'alexnet']
class AlexNet(module.Module): def init(self, num_classes=1000): super(AlexNet, self).init()
12 sur GPU donc 6 & 6
def alexnet(kwargs): return AlexNet(kwargs) ` And I get : AssertionError: ('shape mismatch', (9216, 4096), (256, 4096)) Which is my first linear layer : 256 6 6, 4096
When I use my VGG16 implementation, I got a similar error : AssertionError: ('shape mismatch', (25088, 4096), (512, 4096))
It seems that the backward operation does not map the correct shape to the corresponding layer.
Moreover, the ReLu class return a 1-tuple containing a Tensor. Is it intended or is it a bug?