Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-19700

Creation of small dataset causes python tensor error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Duplicate
    • Affects Version/s: 6.4.10
    • Fix Version/s: None
    • Component/s: Code Generator
    • Labels:
      None

      Description

      The following code causes a python error in the embedded python code. If I comment out the small inline dataset at the top, I get no error. I have attached a ZAP file.

      IMPORT Python;
      subset:=DATASET([
               {'Tare           ','Gonyeau                  '}
               ],{STRING15 FirstName,STRING25 LastName});
      OUTPUT(subset);
      
      rec := RECORD
      	STRING weights;
      	STRING config;
      END;
      
      rec createModel() := EMBED(Python)
      import tensorflow
      import cPickle as pickle
      from tensorflow.python.keras.layers import Dense, Dropout
      from tensorflow.python.keras.models import Sequential
      from tensorflow.python.keras.optimizers import RMSprop
      
      initModel = Sequential()
      initModel.add(Dense(512, activation='relu', input_shape=(100,)))
      initModel.add(Dropout(0.2))
      initModel.add(Dense(512, activation='relu'))
      initModel.add(Dropout(0.2))
      initModel.add(Dense(10, activation='softmax'))
      
      initModel.compile(loss='categorical_crossentropy',
                    optimizer=RMSprop(),
                    metrics=['accuracy'])
      
      model_weights = initModel.get_weights()
      model_config = initModel.get_config()
      
      return ('weights', 'config')
      ENDEMBED;
      
      
      model := createModel();
      OUTPUT(model);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tlhumphrey2 Timothy Humphrey
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: