Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra.yaml for task1b.py stoped with error "AttributeError: 'FeatureContainer' object has no attribute 'sequence_axis'" #6

Open
takeofuture opened this issue Feb 17, 2021 · 1 comment

Comments

@takeofuture
Copy link

takeofuture commented Feb 17, 2021

I try the extra.yaml for example 2 or 3.

python task1b.py -p extra.yaml

then I got

[I]   Collecting training data
[E] Uncaught exception  (logging.py:221)
Traceback (most recent call last):
  File "task1b.py", line 692, in <module>
    sys.exit(main(sys.argv))
  File "task1b.py", line 233, in main
    overwrite=overwrite
  File "/home/sysadmin/AILabs/dcase2020_task1_baseline/task1a.py", line 754, in do_learning
    print_indent=4
  File "/home/sysadmin/anaconda3/envs/dcase2020_tf1/lib/python3.7/site-packages/dcase_util/keras/data.py", line 507, in data_collector
    for i in range(0, data.shape[data.sequence_axis]):
AttributeError: 'FeatureContainer' object has no attribute 'sequence_axi

But it stopped with the following error.
What would be the cause?

Also how does extra.yaml work?
(Does it work on the top on task1a.yaml or task1b.yaml?)

ex.2

active_set: baseline-minified
sets:
  - set_id: baseline-minified
    description: Minified DCASE2020 baseline subtask B minified
    learner_method_parameters:
      cnn:
        model:
          constants:
            CONVOLUTION_KERNEL_SIZE: 3            
    
          config:
            - class_name: Conv2D
              config:
                input_shape:
                  - FEATURE_VECTOR_LENGTH   # data_axis
                  - INPUT_SEQUENCE_LENGTH   # time_axis
                  - 1                       # sequence_axis
                filters: 8
                kernel_size: CONVOLUTION_KERNEL_SIZE
                padding: CONVOLUTION_BORDER_MODE
                kernel_initializer: CONVOLUTION_INIT
                data_format: DATA_FORMAT
            - class_name: Activation
              config:
                activation: CONVOLUTION_ACTIVATION
            - class_name: MaxPooling2D
              config:
                pool_size:
                  - 5
                  - 5
                data_format: DATA_FORMAT
            - class_name: Conv2D
              config:
                filters: 16
                kernel_size: CONVOLUTION_KERNEL_SIZE
                padding: CONVOLUTION_BORDER_MODE
                kernel_initializer: CONVOLUTION_INIT
                data_format: DATA_FORMAT
            - class_name: Activation
              config:
                activation: CONVOLUTION_ACTIVATION
            - class_name: MaxPooling2D
              config:
                pool_size:
                  - 4
                  - 100
                data_format: DATA_FORMAT
            - class_name: Flatten      
            - class_name: Dense
              config:
                units: 100
                kernel_initializer: uniform
                activation: relu    
            - class_name: Dense
              config:
                units: CLASS_COUNT
                kernel_initializer: uniform
                activation: softmax                        
        fit:
            epochs: 100

ex.3

active_set: baseline-kernel3
sets:
  - set_id: baseline-kernel3
    description: DCASE2020 baseline for subtask B with kernel 3
    learner_method_parameters:
      cnn:
        model:
          constants:
            CONVOLUTION_KERNEL_SIZE: 3
        fit:
          epochs: 100                    
  - set_id: baseline-kernel5
    description: DCASE2020 baseline for subtask B with kernel 5
    learner_method_parameters:
      cnn:
        model:
          constants:
            CONVOLUTION_KERNEL_SIZE: 5
        fit:
          epochs: 100
@hannie0615
Copy link

hannie0615 commented Apr 14, 2022

I had the same problem.
I modified the code like this. And then it runs.

active_set: baseline-minified
sets:
  - set_id: baseline-minified
    description: Minified DCASE2021 baseline subtask A minified
    #add from here
    flow:
      feature_normalization: true
    dataset:
      method: baseline_development
    feature_extractor:
      method: mel
    data_processing_chain:
      method: sequencing_chain
    learner:
      method: cnn

  - set_id: baseline-minified
    description: baseline-minified/ Evaluation setup
    path:
      application:
        feature_extractor: eval_features
        recognizer: eval_recognizer

    dataset:
      method: baseline_evaluation

    feature_extractor:
      method: mel

    data_processing_chain:
      method: sequencing_chain

    learner:
      method: cnn

    #add until here

    learner_method_parameters:
      cnn:
        model:
          constants:
            CONVOLUTION_KERNEL_SIZE: 3
    
          config:
            - class_name: Conv2D
              config:
                input_shape:
                  - FEATURE_VECTOR_LENGTH   # data_axis
                  - INPUT_SEQUENCE_LENGTH   # time_axis
                  - 1                       # sequence_axis
                filters: 8
                kernel_size: CONVOLUTION_KERNEL_SIZE
                padding: CONVOLUTION_BORDER_MODE
                kernel_initializer: CONVOLUTION_INIT
                data_format: DATA_FORMAT

            - class_name: Activation
              config:
                activation: CONVOLUTION_ACTIVATION

            - class_name: MaxPooling2D
              config:
                pool_size:
                  - 5
                  - 5
                data_format: DATA_FORMAT

            - class_name: Conv2D
              config:
                filters: 16
                kernel_size: CONVOLUTION_KERNEL_SIZE
                padding: CONVOLUTION_BORDER_MODE
                kernel_initializer: CONVOLUTION_INIT
                data_format: DATA_FORMAT
            - class_name: Activation
              config:
                activation: CONVOLUTION_ACTIVATION

            - class_name: MaxPooling2D
              config:
                pool_size:
                  - 4
                  - 100
                data_format: DATA_FORMAT

            - class_name: Flatten

            - class_name: Dense
              config:
                units: 100
                kernel_initializer: uniform
                activation: relu

            - class_name: Dense
              config:
                units: CLASS_COUNT
                kernel_initializer: uniform
                activation: softmax

        fit:
            epochs: 100
            batch_size: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants