I am having a lot of trouble understanding why exercise 5 is failing. I get the following error:
TypeError: Incompatible shapes for dot: got (16, 13) and (15, 2).
I think my code is fine (as derived from other questions regarding this exercise), so I assume the issue should be on some previous code, but all the previous tests pass just fine.
I’m ussing the classifier as the learning model, giving the training_task, using the list eval_task as is for parameter eval_tasks, and assigning output_dir and n_steps where required.
I need some help to understand what’s going on, since I can’t really figure out where I went wrong.
Hey there I appologise, had a few days away from home and did not notice the repplies. I found @akavaev answer was enough to make the whole thing work properly. Thanks for the offering either way, maybe you can help Teddy if this did not help him
I have no idea how I fixed it, but I was experiencing the same error. I added the keepdims=True parameter to tl.Mean(axis=1) mentioned in another thread, to no avail. However, when I removed the parameter then run the code again it worked and I passed the unit test.
Not saying this is a definite fix, just what worked for me.
I passed all tests in Exercises 1-5, but not Exercise 6. I have mean_layer = tl.Mean(axis=1), but still got the error:
TypeError: mul got incompatible shapes for broadcasting: (32, 2), (16, 2).
It seems that everyone got different shapes in the community. Any help would be appreciated.
Please fix targets in data_generator. Relying on indices to compute target_pos and target_neg is incorrect. See the counter of the for loop to know the number of positive and negative examples in the current batch.
My problem: TypeError: mul got incompatible shapes for broadcasting: (32, 2), (16, 2)
Original Problem: data_generator method, the number of rows of inputs and targets did not match after first iteration. (Thanks teacher Balaji gave me such useful hints)
Solution: check the shape of inputs and targets after second or more batch iteration; if do not match, perhaps that code that creates targets list has some problems.