GundamBen opened a new issue #20147:
URL: https://github.com/apache/incubator-mxnet/issues/20147


   ## Description
   
   Getting error that mxnet does not support SaparableConv1d with mxnet 1.5.0 
and CUDA 10.1. This error will not occur when running the same code in 
tensorflow 1.14.0.
   
   ### Error Message
   
   Traceback (most recent call last):
     File "crashModel.py", line 24, in <module>
       model = Lstm()
     File "crashModel.py", line 17, in Lstm
       model.add(SeparableConv1D(filters = 64, kernel_size = (1)))
     File 
"/root/anaconda3/envs/mxnet/lib/python3.6/site-packages/keras/engine/sequential.py",
 line 181, in add
       output_tensor = layer(self.outputs[0])
     File 
"/root/anaconda3/envs/mxnet/lib/python3.6/site-packages/keras/engine/base_layer.py",
 line 470, in __call__
       output = self.call(inputs, **kwargs)
     File 
"/root/anaconda3/envs/mxnet/lib/python3.6/site-packages/keras/layers/convolutional.py",
 line 1393, in call
       dilation_rate=self.dilation_rate)
     File 
"/root/anaconda3/envs/mxnet/lib/python3.6/site-packages/keras/backend/mxnet_backend.py",
 line 3773, in separable_conv1d
       raise NotImplementedError('MXNet Backend: Separable Conv1D not supported 
yet!')
   NotImplementedError: MXNet Backend: Separable Conv1D not supported yet!
   
   ## To Reproduce
   
   import os
   
   os.environ["CUDA_VISIBLE_DEVICES"] = "2"
   os.environ["KERAS_BACKEND"] = 'mxnet'
   
   from keras.models import Sequential
   from keras.layers import Dense, Dropout, Embedding, LSTM, Bidirectional, 
Reshape, Input, SeparableConv1D, RepeatVector
   
   def Lstm():
       model = Sequential()
       model.add(Embedding(input_dim = 140, output_dim = 128))
       model.add(Bidirectional(LSTM(128)))
       model.add(Dropout(0.5))
       model.add(Dense(64, activation='relu'))
       model.add(Dropout(0.5))
       model.add(RepeatVector(3))
       model.add(SeparableConv1D(filters = 64, kernel_size = (1)))
       model.add(Reshape((192, )))
       model.add(Dense(64, activation='relu'))
       model.add(Dense(2))
       return model
   
   
   model = Lstm()
   model.summary()
   
   ### Steps to reproduce
   (Paste the commands you ran that produced the error.)
   
   1. create a python file and paste code above in it.
   2. set os.environ["KERAS_BACKEND"] = tensorflow and run the file in 
tensorflow, the model works well.
   3. set os.environ["KERAS_BACKEND"] = mxnet and run the file in mxnet, 
programme reports an error.
   
   ## What have you tried to solve it?
   
   1. I used to run the file in the version of 1.5.0. When the error occured, I 
updated mxnet to 1.8.0, but it didn't worked.
   
   ## Environment
   
   <details>
   <summary>Environment Information</summary>
   
   ----------System Info----------
   Platform     : Linux-4.15.0-123-generic-x86_64-with-debian-stretch-sid
   system       : Linux
   node         : 3bb941e39736
   release      : 4.15.0-123-generic
   version      : #126-Ubuntu SMP Wed Oct 21 09:40:11 UTC 2020
   
   ----------Python Info----------
   Version      : 3.6.12
   Compiler     : GCC 7.3.0
   Build        : ('default', 'Sep  8 2020 23:10:56')
   Arch         : ('64bit', '')
   
   mxnet version 1.8.0
   cuda version 10.1
   tensorflow version 1.14.0
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to