C1W1 assignment Argument 'b' passed to 'mul' must be a Tensor or TensorLike

Hi everyone,

I’m encountering an issue in the assignment of C1W1. The error message is:

Uncaught (in promise) Error: Argument ‘b’ passed to ‘mul’ must be a Tensor or TensorLike, but got ‘Object’

I suspect the problem is in my data preparation steps, where I’m converting CSV data to tensors for training and testing. My code is however similar to the ungraded labs, and I’ve tried multiples alternatives to change the size and shape of the data, without success. Currently, I have:

const convertedTrainingData =
trainingData.map(({xs, ys}) => {
return{ xs: Object.values(xs), ys: Object.values(ys)};
}).batch(10)

Any insights on what might be causing this issue and how to resolve it?

Thanks in advance!

Hi @Matt0876

Your conversion looks correct. Make sure that the other parts of your code are also correctly implemented (e.g. loading the CSV file with the correct config, etc.)

Hope it helps! Feel free to ask if you need further assistance.