I have a submission problem that I have passed all the cases when I run in but only got a 33/100 on submission. I was able to run all the code on jupyter but the below message tells me that the function is not defined…
Please help
Grader output
[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W2A2/Transfer_learning_with_MobileNet_v1.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
2021-05-04 05:13:18.295420: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘libcudart.so.10.1’; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory
2021-05-04 05:13:18.295462: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2021-05-04 05:13:19.401103: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library ‘libcuda.so.1’; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-05-04 05:13:19.401136: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
2021-05-04 05:13:19.401154: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (ip-10-3-0-50.ec2.internal): /proc/driver/nvidia/version does not exist
2021-05-04 05:13:19.401405: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-05-04 05:13:19.425698: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2999995000 Hz
2021-05-04 05:13:19.427776: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5591c2094a30 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-05-04 05:13:19.427804: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Tests failed on 2 cell(s)! These tests could be hidden. Please check your submission.
The following cell failed:
from test_utils import summary, comparator
alpaca_summary = [['InputLayer', [(None, 160, 160, 3)], 0],
['Sequential', (None, 160, 160, 3), 0],
['TensorFlowOpLayer', [(None, 160, 160, 3)], 0],
['TensorFlowOpLayer', [(None, 160, 160, 3)], 0],
['Functional', (None, 5, 5, 1280), 2257984],
['GlobalAveragePooling2D', (None, 1280), 0],
['Dropout', (None, 1280), 0, 0.2],
['Dense', (None, 1), 1281, 'linear']] #linear is the default ac...
comparator(summary(model2), alpaca_summary)
for layer in summary(model2):
print(layer)
The error was:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-17-adf7881e6456> in <module>
10 ['Dense', (None, 1), 1281, 'linear']] #linear is the de...
11
---> 12 comparator(summary(model2), alpaca_summary)
13
14 for layer in summary(model2):
NameError: name 'model2' is not defined
==========================================================================================
The following cell failed:
assert type(loss_function) == tf.python.keras.losses.BinaryCrossentropy, "Not the c...
assert loss_function.from_logits, "Use from_logits=True"
assert type(optimizer) == tf.keras.optimizers.Adam, "This is not an Adam optimizer"
assert optimizer.lr == base_learning_rate / 10, "Wrong learning rate"
assert metrics[0] == 'accuracy', "Wrong metric"
print('\033[92mAll tests passed!')
The error was:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-23-2a3573945f89> in <module>
----> 1 assert type(loss_function) == tf.python.keras.losses.BinaryCrossentropy, "N...
2 assert loss_function.from_logits, "Use from_logits=True"
3 assert type(optimizer) == tf.keras.optimizers.Adam, "This is not an Adam op...
4 assert optimizer.lr == base_learning_rate / 10, "Wrong learning rate"
5 assert metrics[0] == 'accuracy', "Wrong metric"
NameError: name 'loss_function' is not defined