Skip to content

ACS111113#96

Open
darkness741852 wants to merge 1 commit into
rich7420:mainfrom
darkness741852:main
Open

ACS111113#96
darkness741852 wants to merge 1 commit into
rich7420:mainfrom
darkness741852:main

Conversation

@darkness741852

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

Autograding Result:

Grading Results:
- File name format: ACS111113_CNN_Assignment.ipynb
- Notebook execution: Failed
- Model Performance: Not available (execution may have failed)
Debug: Checking test_output.txt existence
Debug: test_output.txt exists, content:
Test execution started at Thu Jun 26 13:38:33 UTC 2025
============================= test session starts ==============================
platform linux -- Python 3.10.17, pytest-8.4.1, pluggy-1.6.0 -- /opt/hostedtoolcache/Python/3.10.17/x64/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/CNN-Assignment-2025/CNN-Assignment-2025
plugins: anyio-4.9.0
collecting ... collected 6 items

tests/test_cnn.py::test_file_name PASSED                                 [ 16%]
tests/test_cnn.py::test_task_1_model_changes PASSED                      [ 33%]
tests/test_cnn.py::test_task_2_hyperparameters PASSED                    [ 50%]
tests/test_cnn.py::test_task_3_data_augmentation FAILED                  [ 66%]
tests/test_cnn.py::test_task_4_visualization PASSED                      [ 83%]
tests/test_cnn.py::test_task_5_report PASSED                             [100%]

=================================== FAILURES ===================================
________________________ test_task_3_data_augmentation _________________________

    def test_task_3_data_augmentation():
        nb_file = [f for f in glob.glob("*_CNN_Assignment.ipynb") if not f.startswith('executed_')][0]
        nb = load_notebook(nb_file)
        augmentation_code = ""
        for cell in nb.cells:
            if cell.cell_type == 'code' and 'ImageDataGenerator' in cell.source:
                augmentation_code = cell.source
                break
        if not augmentation_code:
            print("Warning: Task 3: ImageDataGenerator not found, passing with reduced score")
            return
>       assert any(param in augmentation_code for param in ['rotation_range', 'width_shift_range', 'height_shift_range', 'horizontal_flip']), \
            "Task 3: ImageDataGenerator must include at least one augmentation parameter"
E       AssertionError: Task 3: ImageDataGenerator must include at least one augmentation parameter
E       assert False
E        +  where False = any(<generator object test_task_3_data_augmentation.<locals>.<genexpr> at 0x7f99a2fa2c00>)

tests/test_cnn.py:62: AssertionError
=========================== short test summary info ============================
FAILED tests/test_cnn.py::test_task_3_data_augmentation - AssertionError: Task 3: ImageDataGenerator must include at least one augmentation parameter
assert False
 +  where False = any(<generator object test_task_3_data_augmentation.<locals>.<genexpr> at 0x7f99a2fa2c00>)
========================= 1 failed, 5 passed in 0.19s ==========================
Warning: pytest execution failed
test_output.txt content after pytest:
Test execution started at Thu Jun 26 13:38:33 UTC 2025
============================= test session starts ==============================
platform linux -- Python 3.10.17, pytest-8.4.1, pluggy-1.6.0 -- /opt/hostedtoolcache/Python/3.10.17/x64/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/CNN-Assignment-2025/CNN-Assignment-2025
plugins: anyio-4.9.0
collecting ... collected 6 items

tests/test_cnn.py::test_file_name PASSED                                 [ 16%]
tests/test_cnn.py::test_task_1_model_changes PASSED                      [ 33%]
tests/test_cnn.py::test_task_2_hyperparameters PASSED                    [ 50%]
tests/test_cnn.py::test_task_3_data_augmentation FAILED                  [ 66%]
tests/test_cnn.py::test_task_4_visualization PASSED                      [ 83%]
tests/test_cnn.py::test_task_5_report PASSED                             [100%]

=================================== FAILURES ===================================
________________________ test_task_3_data_augmentation _________________________

    def test_task_3_data_augmentation():
        nb_file = [f for f in glob.glob("*_CNN_Assignment.ipynb") if not f.startswith('executed_')][0]
        nb = load_notebook(nb_file)
        augmentation_code = ""
        for cell in nb.cells:
            if cell.cell_type == 'code' and 'ImageDataGenerator' in cell.source:
                augmentation_code = cell.source
                break
        if not augmentation_code:
            print("Warning: Task 3: ImageDataGenerator not found, passing with reduced score")
            return
>       assert any(param in augmentation_code for param in ['rotation_range', 'width_shift_range', 'height_shift_range', 'horizontal_flip']), \
            "Task 3: ImageDataGenerator must include at least one augmentation parameter"
E       AssertionError: Task 3: ImageDataGenerator must include at least one augmentation parameter
E       assert False
E        +  where False = any(<generator object test_task_3_data_augmentation.<locals>.<genexpr> at 0x7f99a2fa2c00>)

tests/test_cnn.py:62: AssertionError
=========================== short test summary info ============================
FAILED tests/test_cnn.py::test_task_3_data_augmentation - AssertionError: Task 3: ImageDataGenerator must include at least one augmentation parameter
assert False
 +  where False = any(<generator object test_task_3_data_augmentation.<locals>.<genexpr> at 0x7f99a2fa2c00>)
========================= 1 failed, 5 passed in 0.19s ==========================
Warning: pytest execution failed
test_output.txt content after pytest:
Debug: Running grep commands
- Task 1 (File Name): Pass
- Task 2 (Model Changes): Pass
- Task 3 (Hyperparameters): Pass
- Task 4 (Data Augmentation): Fail
- Task 5 (Visualization): Pass
- Task 6 (Report): Pass

@darkness741852

Copy link
Copy Markdown
Author

The modified code uses Tensorflow, which might be the reason the notebook execution failed (Tensorflow is currently incompatible with Python versions 3.10 or above, which might be what the Pytest is running on). The code runs perfectly fine on Google Colab, which should be evident by the contents of the .ipynb file.

@darkness741852

Copy link
Copy Markdown
Author
        Model Performance Summary:,
        Test Accuracy: 0.8513,
        Test Loss: 0.4689,
        Final Training Accuracy: 0.8382,
        Final Validation Accuracy: 0.8583,
        Final Training Loss: 0.4780,
        Final Validation Loss: 0.4399,
        Training Epochs: 20,
        Model Parameters: 552874

@rich7420

Copy link
Copy Markdown
Owner

viewed

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

Successfully merging this pull request may close these issues.

2 participants