C2W2_Assignment Exercise 2 - name 'dataset' is not defined

Hi,

getting lost to fix this error in coursera Lap. as i not finding a hint nor a solution in documents.

Any Idea ? Any Hint.
Thanks you for

Blockquote

### END CODE HERE
return records

Blockquote
Blockquote

grader-required-cell

Get 3 records from the dataset

sample_records = get_records(dataset, 3)

Print the output

pp.pprint(sample_records)

Blockquote


I got this error


NameError Traceback (most recent call last)
in
2
3 # Get 3 records from the dataset
----> 4 sample_records = get_records(dataset, 3)
5
6 # Print the output

NameError: name ‘dataset’ is not defined

The error means that the parameter dataset passed to the function is not found. I think what could be happening in here is either you forgot to run a previous cell or you havent assigned the dataset variable to the right output obtained from a previous operation.

Thanks for the quick answer.
Somehow i restarted any cells before.

Same result - maybe there is problem with the notebook itself.

As in 1. Exercise i have to and

Blockquote

START CODE HERE

Instantiate ExampleGen with the input CSV dataset
example_gen = tfx.components.CsvExampleGen(input_base=_data_root)

Run the component using the InteractiveContext instance
context.run(example_gen)

END CODE HERE

Blockquote

After add the tfx.components with the first run i got that error

Blockquote
WARNING:root:Make sure that locally built Python SDK docker image has Python 3.8 interpreter.
Blockquote

After second run - the part above works - means no error message

1 Like

But not my inital question is resolved. I have no idea how to fix it or even where to start looking for a solution.

You have to follow the logical steps and trace the error yourself based on the info I gave you. That would be your starting point.

I found so far, that i have a problem with the “Coursera Assignments” which starts with first Cell. " 1.1. Imports". I can not fix or added additional modules. The Cell is read only.
So i have to fix that with each Exercise Cell.

Or it there a “way to change /add global” ?
Otherwise I have “the pleasure” to find in each exercise what TFX components i have to import.


My solution , which works for me:

e.g, with C2W2_Assignment. I have to added

### START CODE HERE
import tensorflow as tf
from tfx import v1 as tfx

# TFX components
from tfx.components import CsvExampleGen

# Instantiate ExampleGen with the input CSV dataset
example_gen =  CsvExampleGen(input_base=_data_root)

# Run the component using the InteractiveContext instance
context.run(example_gen)

hello
i have some problemas too
however the say i passed the test in same exercise the great of the exercise didnt calculate

i write the # grade up here
but nothing ,

can you help me maybe

@Vaso_Sapouna were you able to grade your assignment?