C2W4 Assignment Trouble

I am getting to this part of the assignment. Now, I got an “type error”.
Can anybody look below and help me?


Test your function

path_sign_mnist_train = f"{getcwd()}/sign_mnist_train.csv"

path_sign_mnist_test = f"{getcwd()}/sign_mnist_test.csv"

training_images, training_labels = parse_data_from_input(path_sign_mnist_train)

validation_images, validation_labels = parse_data_from_input(path_sign_mnist_test)

print(f"Training images has shape: {training_images.shape} and dtype: {training_images.dtype}")

print(f"Training labels has shape: {training_labels.shape} and dtype: {training_labels.dtype}")

print(f"Validation images has shape: {validation_images.shape} and dtype: {validation_images.dtype}")

print(f"Validation labels has shape: {validation_labels.shape} and dtype: {validation_labels.dtype}")

“Error Part”

TypeError Traceback (most recent call last)
in ()
3 path_sign_mnist_test = f"{getcwd()}/sign_mnist_test.csv"
----> 5 training_images, training_labels = parse_data_from_input(path_sign_mnist_train)
6 validation_images, validation_labels = parse_data_from_input(path_sign_mnist_test)

in parse_data_from_input(filename)
12 with open(filename) as file:
—> 14 read=csv.reader(training_file,delimiter=’.’)
15 first_line=True
16 temp_images=

TypeError: argument 1 must be an iterator

This error points to this line in code:

—> 14 read=csv.reader(training_file,delimiter=’.’)

The first parameter to csv.reader should be the file handle which is an iterable. You are providing the name of the file which is training_file.