problem with input_shape keras model in Convolution Neural Network

a_lotti1a_lotti1 Member Posts: 7 Contributor I
edited December 2018 in Help
Hi everyone,
I have a csv dataset composed of 301 attributes and I would like to pass in my keras model 5 rows at a time and then create a 2d convolution level and 2d MaxPooling.
As input_shape I inserted (301,5,1) -> "width, height, depth" following an online example.
As soon as the process is launched, RapidMiner stops responding and displays the following error screen.
Now the number of convolution level filters is 301, but it is only one case that is equal to the number of width.
Could you help me solve the problem?
Thanks a lot.


<?xml version="1.0" encoding="UTF-8"?><process version="9.1.000">
<context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="9.1.000" expanded="true" name="Process">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="2001"/>
    <parameter key="send_mail" value="always"/>
    <parameter key="notification_email" value="[email protected]"/>
    <parameter key="process_duration_for_mail" value="30"/>
    <parameter key="encoding" value="SYSTEM"/>
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="9.1.000" expanded="true" height="68" name="Retrieve Admire3_Shift24_Step12" width="90" x="112" y="340">
        <parameter key="repository_entry" value="Admire3 Shifter/Admire3_Shift24_Step12"/>
      </operator>
      <operator activated="true" class="rename" compatibility="9.1.000" expanded="true" height="82" name="Rename (6)" width="90" x="246" y="340">
        <parameter key="old_name" value="att302"/>
        <parameter key="new_name" value="KP"/>
        <list key="rename_additional_attributes"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="9.1.000" expanded="true" height="82" name="Set Role Train (6)" origin="GENERATED_SAMPLE" width="90" x="380" y="340">
        <parameter key="attribute_name" value="KP"/>
        <parameter key="target_role" value="label"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="9.1.000" expanded="true" height="68" name="Retrieve Admire1_Shift24_Step12" width="90" x="112" y="493">
        <parameter key="repository_entry" value="Admire1 Shifter/Admire1_Shift24_Step12"/>
      </operator>
      <operator activated="true" class="rename" compatibility="9.1.000" expanded="true" height="82" name="Rename (3)" width="90" x="246" y="493">
        <parameter key="old_name" value="att302"/>
        <parameter key="new_name" value="KP"/>
        <list key="rename_additional_attributes"/>
      </operator>
      <operator activated="true" class="set_role" compatibility="9.1.000" expanded="true" height="82" name="Set Role Test (3)" origin="GENERATED_SAMPLE" width="90" x="380" y="493">
        <parameter key="attribute_name" value="KP"/>
        <parameter key="target_role" value="label"/>
        <list key="set_additional_roles"/>
      </operator>
      <operator activated="true" class="keras:sequential" compatibility="1.0.003" expanded="true" height="166" name="Keras Model (3)" width="90" x="514" y="340">
        <parameter key="input shape" value="(1,5,301)"/>
        <parameter key="loss" value="categorical_crossentropy"/>
        <parameter key="optimizer" value="Adam"/>
        <parameter key="learning rate" value="0.001"/>
        <parameter key="momentum" value="0.0"/>
        <parameter key="rho" value="0.9"/>
        <parameter key="beta 1" value="0.999"/>
        <parameter key="beta 2" value="0.999"/>
        <parameter key="epsilon" value="1.0E-8"/>
        <parameter key="decay" value="0.0"/>
        <parameter key="schedule decay" value="0.004"/>
        <parameter key="Nesterov" value="false"/>
        <parameter key="use metric" value="false"/>
        <enumeration key="metric"/>
        <parameter key="epochs" value="512"/>
        <parameter key="batch size" value="64"/>
        <enumeration key="callbacks">
          <parameter key="callbacks" value="TensorBoard(log_dir='./logs', histogram_freq=0, write_graph=True, write_images=False, embeddings_freq=0, embeddings_layer_names=None, embeddings_metadata=None)"/>
        </enumeration>
        <parameter key="verbose" value="1"/>
        <parameter key="validation split" value="0.0"/>
        <parameter key="shuffle" value="false"/>
        <parameter key="fix seed" value="false"/>
        <parameter key="random seed" value="0"/>
        <process expanded="true">
          <operator activated="true" class="keras:conv_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Convolutional Layer (2)" width="90" x="648" y="34">
            <parameter key="layer_type" value="Conv2D"/>
            <parameter key="filters" value="301"/>
            <parameter key="kernel_size_1d" value="9"/>
            <parameter key="kernel_size_2d" value="2.2"/>
            <parameter key="kernel_size_3d" value="1.1"/>
            <parameter key="strides_1d" value="9"/>
            <parameter key="strides_2d" value="1.1"/>
            <parameter key="strides_3d" value="1.1"/>
            <parameter key="padding" value="valid"/>
            <parameter key="padding_1d" value="1."/>
            <parameter key="padding_2d" value="(1, 1)"/>
            <parameter key="padding_3d" value="(1, 1, 1)"/>
            <parameter key="cropping_1d" value="1.1"/>
            <parameter key="cropping_2d" value="((1, 1), (1, 1))"/>
            <parameter key="cropping_3d" value="((1, 1), (1, 1), (1, 1))"/>
            <parameter key="size_1d" value="2"/>
            <parameter key="size_2d" value="2.2"/>
            <parameter key="size_3d" value="2.2"/>
            <parameter key="data_format" value="'channels_last'"/>
            <parameter key="dilation_rate_1d" value="1"/>
            <parameter key="dilation_rate_2d" value="1.1"/>
            <parameter key="dilation_rate_3d" value="1.1"/>
            <parameter key="depth_multiplier" value="1"/>
            <parameter key="activation_function" value="'relu'"/>
            <parameter key="use_bias" value="true"/>
            <parameter key="kernel_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="bias_initializer" value="Zeros()"/>
            <parameter key="depthwise_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="pointwise_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="kernel_regularizer" value="None"/>
            <parameter key="bias_regularizer" value="None"/>
            <parameter key="activity_regularizer" value="None"/>
            <parameter key="depthwise_regularizer" value="None"/>
            <parameter key="pointwise_regularizer" value="None"/>
            <parameter key="kernel_constraint" value="None"/>
            <parameter key="bias_constraint" value="None"/>
            <parameter key="depthwise_constraint" value="None"/>
            <parameter key="pointwise_constraint" value="None"/>
          </operator>
          <operator activated="true" class="keras:pooling_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Pooling Layer (3)" width="90" x="648" y="136">
            <parameter key="layer_type" value="MaxPooling2D"/>
            <parameter key="pool_size_1d" value="2"/>
            <parameter key="pool_size_2d" value="2.1"/>
            <parameter key="pool_size_3d" value="2.2"/>
            <parameter key="strides_1d" value="1"/>
            <parameter key="strides_2d" value="1.1"/>
            <parameter key="strides_3d" value="2.2"/>
            <parameter key="padding" value="valid"/>
            <parameter key="data_format" value="None"/>
          </operator>
          <operator activated="true" class="keras:core_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Core Layer (3)" width="90" x="782" y="34">
            <parameter key="layer_type" value="Dropout"/>
            <parameter key="no_units" value="1"/>
            <parameter key="activation_function" value="None"/>
            <parameter key="use_bias" value="true"/>
            <parameter key="kernel_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="bias_initializer" value="Zeros()"/>
            <parameter key="kernel_regularizer" value="None"/>
            <parameter key="bias_regularizer" value="None"/>
            <parameter key="activity_regularizer" value="None"/>
            <parameter key="kernel_constraint" value="None"/>
            <parameter key="bias_constraint" value="None"/>
            <parameter key="rate" value="0.25"/>
            <parameter key="noise_shape" value="None"/>
            <parameter key="seed" value="None"/>
            <parameter key="target_shape" value="1.1"/>
            <parameter key="dims" value="1.1"/>
            <parameter key="repetition_factor" value="2"/>
            <parameter key="function" value="None"/>
            <parameter key="l1" value="0.0"/>
            <parameter key="l2" value="0.0"/>
            <parameter key="mask_value" value="0.0"/>
          </operator>
          <operator activated="true" class="keras:core_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Core Layer (5)" width="90" x="916" y="34">
            <parameter key="layer_type" value="Flatten"/>
            <parameter key="no_units" value="1"/>
            <parameter key="activation_function" value="None"/>
            <parameter key="use_bias" value="true"/>
            <parameter key="kernel_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="bias_initializer" value="Zeros()"/>
            <parameter key="kernel_regularizer" value="None"/>
            <parameter key="bias_regularizer" value="None"/>
            <parameter key="activity_regularizer" value="None"/>
            <parameter key="kernel_constraint" value="None"/>
            <parameter key="bias_constraint" value="None"/>
            <parameter key="rate" value="0.1"/>
            <parameter key="noise_shape" value="None"/>
            <parameter key="seed" value="None"/>
            <parameter key="target_shape" value="1.1"/>
            <parameter key="dims" value="1.1"/>
            <parameter key="repetition_factor" value="2"/>
            <parameter key="function" value="None"/>
            <parameter key="l1" value="0.0"/>
            <parameter key="l2" value="0.0"/>
            <parameter key="mask_value" value="0.0"/>
          </operator>
          <operator activated="true" class="keras:core_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Core Layer (7)" width="90" x="1050" y="34">
            <parameter key="layer_type" value="Dense"/>
            <parameter key="no_units" value="160"/>
            <parameter key="activation_function" value="'sigmoid'"/>
            <parameter key="use_bias" value="true"/>
            <parameter key="kernel_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="bias_initializer" value="Zeros()"/>
            <parameter key="kernel_regularizer" value="None"/>
            <parameter key="bias_regularizer" value="None"/>
            <parameter key="activity_regularizer" value="None"/>
            <parameter key="kernel_constraint" value="None"/>
            <parameter key="bias_constraint" value="None"/>
            <parameter key="rate" value="0.1"/>
            <parameter key="noise_shape" value="None"/>
            <parameter key="seed" value="None"/>
            <parameter key="target_shape" value="1.1"/>
            <parameter key="dims" value="1.1"/>
            <parameter key="repetition_factor" value="2"/>
            <parameter key="function" value="None"/>
            <parameter key="l1" value="0.0"/>
            <parameter key="l2" value="0.0"/>
            <parameter key="mask_value" value="0.0"/>
          </operator>
          <operator activated="true" class="keras:core_layer" compatibility="1.0.003" expanded="true" height="82" name="Add Core Layer (10)" width="90" x="1184" y="34">
            <parameter key="layer_type" value="Dense"/>
            <parameter key="no_units" value="5"/>
            <parameter key="activation_function" value="'sigmoid'"/>
            <parameter key="use_bias" value="true"/>
            <parameter key="kernel_initializer" value="glorot_uniform(seed=None)"/>
            <parameter key="bias_initializer" value="Zeros()"/>
            <parameter key="kernel_regularizer" value="None"/>
            <parameter key="bias_regularizer" value="None"/>
            <parameter key="activity_regularizer" value="None"/>
            <parameter key="kernel_constraint" value="None"/>
            <parameter key="bias_constraint" value="None"/>
            <parameter key="rate" value="0.1"/>
            <parameter key="noise_shape" value="None"/>
            <parameter key="seed" value="None"/>
            <parameter key="target_shape" value="1.1"/>
            <parameter key="dims" value="1.1"/>
            <parameter key="repetition_factor" value="2"/>
            <parameter key="function" value="None"/>
            <parameter key="l1" value="0.0"/>
            <parameter key="l2" value="0.0"/>
            <parameter key="mask_value" value="0.0"/>
          </operator>
          <connect from_op="Add Convolutional Layer (2)" from_port="layers 1" to_op="Add Pooling Layer (3)" to_port="layers"/>
          <connect from_op="Add Pooling Layer (3)" from_port="layers 1" to_op="Add Core Layer (3)" to_port="layers"/>
          <connect from_op="Add Core Layer (3)" from_port="layers 1" to_op="Add Core Layer (5)" to_port="layers"/>
          <connect from_op="Add Core Layer (5)" from_port="layers 1" to_op="Add Core Layer (7)" to_port="layers"/>
          <connect from_op="Add Core Layer (7)" from_port="layers 1" to_op="Add Core Layer (10)" to_port="layers"/>
          <connect from_op="Add Core Layer (10)" from_port="layers 1" to_port="layers 1"/>
          <portSpacing port="sink_layers 1" spacing="0"/>
          <portSpacing port="sink_layers 2" spacing="0"/>
          <description align="center" color="yellow" colored="false" height="105" resized="false" width="180" x="1030" y="132">Il layer FLATTEN &amp;#232; usato per Input a pi&amp;#249; dimensioni e trasforma un layer a pi&amp;#249; dimensioni in una</description>
        </process>
      </operator>
      <operator activated="true" class="keras:apply" compatibility="1.0.003" expanded="true" height="82" name="Apply Keras Model (4)" origin="GENERATED_SAMPLE" width="90" x="648" y="493">
        <parameter key="batch_size" value="32"/>
        <parameter key="verbose" value="0"/>
      </operator>
      <operator activated="true" class="performance" compatibility="9.1.000" expanded="true" height="82" name="45_23" width="90" x="782" y="493">
        <parameter key="use_example_weights" value="false"/>
      </operator>
      <connect from_op="Retrieve Admire3_Shift24_Step12" from_port="output" to_op="Rename (6)" to_port="example set input"/>
      <connect from_op="Rename (6)" from_port="example set output" to_op="Set Role Train (6)" to_port="example set input"/>
      <connect from_op="Set Role Train (6)" from_port="example set output" to_op="Keras Model (3)" to_port="training set"/>
      <connect from_op="Retrieve Admire1_Shift24_Step12" from_port="output" to_op="Rename (3)" to_port="example set input"/>
      <connect from_op="Rename (3)" from_port="example set output" to_op="Set Role Test (3)" to_port="example set input"/>
      <connect from_op="Set Role Test (3)" from_port="example set output" to_op="Apply Keras Model (4)" to_port="unlabelled data"/>
      <connect from_op="Keras Model (3)" from_port="model" to_op="Apply Keras Model (4)" to_port="model"/>
      <connect from_op="Keras Model (3)" from_port="layers 1" to_port="result 2"/>
      <connect from_op="Apply Keras Model (4)" from_port="labelled data" to_op="45_23" to_port="labelled data"/>
      <connect from_op="45_23" from_port="performance" to_port="result 1"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
    </process>
  </operator>
</process>
 
Sign In or Register to comment.