I’m passing all the tests but getting only 80% from the grader for this rather mysterious reason. Not sure how to proceed:
Hide grader output
Grader output
[ValidateApp | INFO] Validating '/home/jovyan/work/submitted/courseraLearner/W3A1/Tensorflow_introduction.ipynb'
[ValidateApp | INFO] Executing notebook with kernel: python3
2021-07-26 17:22:28.185620: 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-07-26 17:22:28.185663: 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-07-26 17:22:29.335335: 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-07-26 17:22:29.335376: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
2021-07-26 17:22:29.335402: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (somehost): /proc/driver/nvidia/version does not exist
2021-07-26 17:22:29.335688: 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-07-26 17:22:29.342063: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2999995000 Hz
2021-07-26 17:22:29.342887: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f002618a0b0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-07-26 17:22:29.342918: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.
Yes, it is unfortunate that the grader cannot say anything more specific than that. Believe me, we have pointed this out to the course staff as being (how shall we say) “unhelpful” but apparently this is a limitation of the grader platform as provided by Coursera. Sigh …
It would be nice if you could specify which assignment you’re talking about when you make a post like this, but fortunately there are enough clues in the grader output to see that it’s the Tensorflow Introduction assignment in Course 2 Week 3.
One thing to be aware of is that they have published a new version of this assignment just a few days back and then there was a fix to the new version. The first thing to check is that you’ve got the latest version. An easy way to check is to compare the “Expected Value” for the compute_cost function. The latest version should show this value:
Expected output
tf.Tensor(0.4051435, shape=(), dtype=float32)
If that’s not what you see there, then the first step is to upgrade to the latest. There’s a topic about that on the FAQ Thread.
If you have the latest version, I assume you’ve double checked to make sure you pass all the tests in the notebook.
Also are you sure you can’t “scroll down” on that grader output section? I just tried intentionally making a mistake in compute_cost and I get the same preamble that you show from the grader, but then there’s a section below that which shows specifically that compute_cost is wrong:
2021-07-26 21:35:41.121047: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f43c160dc40 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2021-07-26 21:35:41.121078: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Tests failed on 1 cell(s)! These tests could be hidden. Please check your submission.
==========================================================================================
The following cell failed:
def compute_cost_test(target, Y):
pred = tf.constant([[ 2.4048107, 5.0334096 ],
[-0.7921977, -4.1523376 ],
[ 0.9447198, -0.46802214],
[ 1.158121, 3.9810789 ],
[ 4.768706, 2.3220146 ],
[ 6.1481323, 3.909829 ]])
minibatches = Y.batch(2)
for minibatch in minibatches:
result = target(pred, tf.transpose(minibatch))
break
print(result)
assert(type(result) == EagerTensor), "Use the TensorFlow API"
assert (np.abs(result - (0.25361037 + 0.5566767) / 2.0) < 1e-7), "Test does not...
print("\033[92mAll test passed")
compute_cost_test(compute_cost, new_y_train )
The error was:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-34-00be00e6d471> in <module>
17 print("\033[92mAll test passed")
18
---> 19 compute_cost_test(compute_cost, new_y_train )
<ipython-input-34-00be00e6d471> in compute_cost_test(target, Y)
13 print(result)
14 assert(type(result) == EagerTensor), "Use the TensorFlow API"
---> 15 assert (np.abs(result - (0.25361037 + 0.5566767) / 2.0) < 1e-7), "Test ...
16
17 print("\033[92mAll test passed")
AssertionError: Test does not match. Did you get the mean of your cost functions?
Mind you, the mistake I made was bad enough that it also failed the test case in the notebook, so it’s entirely possible that this example is not relevant to your situation.
First off, I really appreciate you taking the time to reply to this, and I’m facepalming that I left off the Course number and Week. (I got used to the Coursera “Course 2 Week 3” forum and forgot this format is flat).
Sadly, I do appear to have the updated assignment, as
tf.Tensor(0.4051435, shape=(), dtype=float32)
is the expected result.
There is no more text in the grader output than what I linked.
I earlier had some issues with the one_hot_matrix function, trying shapes of (depth) and (depth, 1) before finally finding (depth, ) as the only one that satisfied both one_hot_matrix_test() and new_y_test = y_test.map(one_hot_matrix).
But now that those tests are passing I have no idea if my one_hot_matrix troubles the grader. All the expected values are met.
Hi, David.
Thanks for the followup! Did you by any chance start on this assignment more than a couple of days ago and try to port your solution forward? As you point out, there are some kind of subtle things that they changed when they updated this maybe 4 or 5 days ago. That business with the one_hot outputs being a 1D tensor is one that stands out. I just went through the exercise a couple of days ago of updating to the latest version and that was one that puzzled me a bit. I confess I’m still not sure why they went that way …
Well, I first hit “work in browser” before the last update on, I think, 7/24. But I didn’t write any code until after that update.