keras-js icon indicating copy to clipboard operation
keras-js copied to clipboard

Conv2DTranspose problem

Open gmalivenko opened this issue 7 years ago • 1 comments

I have 2 problems with Conv2DTranspose layer:

  1. When I try to create model with gpu: false an error with shapes occurs:
Error: Mismatched array shapes for matrix product
  1. Same model, with gpu: false. There are several warnings:
WebGL: INVALID_VALUE: texImage2D: width or height out of range

And wrong prediction in the end.

I suppose there is a problem with Conv2DTranspose layer. Original TF + Keras works well.

Model summary:

_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
input (InputLayer)           (None, 3, 1, 1)           0         
_________________________________________________________________
ConvNd_0 (Conv2DTranspose)   (None, 512, 4, 4)         25088     
_________________________________________________________________
SELU_1 (Activation)          (None, 512, 4, 4)         0         
_________________________________________________________________
ConvNd_2 (Conv2DTranspose)   (None, 256, 8, 8)         2097408   
_________________________________________________________________
SELU_3 (Activation)          (None, 256, 8, 8)         0         
_________________________________________________________________
ConvNd_4 (Conv2DTranspose)   (None, 128, 16, 16)       524416    
_________________________________________________________________
SELU_5 (Activation)          (None, 128, 16, 16)       0         
_________________________________________________________________
ConvNd_6 (Conv2DTranspose)   (None, 64, 32, 32)        131136    
_________________________________________________________________
SELU_7 (Activation)          (None, 64, 32, 32)        0         
_________________________________________________________________
ConvNd_8 (Conv2DTranspose)   (None, 32, 64, 64)        32800     
_________________________________________________________________
SELU_9 (Activation)          (None, 32, 64, 64)        0         
_________________________________________________________________
ConvNd_10 (Conv2DTranspose)  (None, 3, 128, 128)       1539      
_________________________________________________________________
Tanh_11 (Activation)         (None, 3, 128, 128)       0         
=================================================================
Total params: 2,812,387
Trainable params: 2,812,387

A keras model: model.zip

Browser 1: Firefox 57.0 Browser 2: Chromium 62.0 Browser 3: Firefox 56.0 (Win64)

gmalivenko avatar Nov 27 '17 22:11 gmalivenko

Update: I thought the problem was with dimension ordering (in previous model it was CHW), so, I've converted the model to other dimension ordering (HWC).

A new error in a console:

Error: [Model] error loading weights.

gmalivenko avatar Dec 03 '17 10:12 gmalivenko