Unet_model error

please help me detect my error at unet model

When you use conv_block(…), you need to specify the [0] element of the previous layer. Just using “cblock1” is not sufficient.

I corrected but still got another error in ublock7

Compare what the output of the upsampling block is, versus what the output of the downsampling block. They are different, so you need to handle them appropriately. You need to pay attention to the details here.

Also note that in both cases you are not really showing us the last critical line of the exception trace: what the actual error is. But we can see from looking at your code what your error is in these two cases.

It’s very confusing.

ublock7, 8, and 9 do not use the indexing style that ublock6 uses.

right, it is confusing, 6,7 & 8 ublocks hos no indexes but 3,2 & 1 have. I was able to guess it right, thank you for your help.
one more question, when I run this model with 8 millions parameters in coursera system it run fast, but in my computer takes forever, what kind of computer do you suggest me to get similar speed. I would appreciate a concrete suggestion
Thank you again

Coursera Labs uses a GPU farm that’s provided by AWS.
So its a lot faster than any single computer could be.

so there is not a GPU available for a single computer? I do not need coursera speed but a decent one

Yes, you could use a GPU attached to your own computer. It may or may not be sufficient for your use. I have not tried this setup personally, so I don’t have any specific guidance.

Thank you anyway, I will keep investigating. your team is very helpful answering our doubts, as the courses progresses the subjects get harder

Like Tom, I have no personal experience with running GPUs on a local computer. But I’ve heard from other people that they are very expensive and in short supply at this point. The other possibility is to use Google Colab. I think they have even more GPU/TPU power available than Coursera does. They also run Jupyter Notebooks. I’ve tried it and it works well even with a free account. The only issue with a free account is that the paying users get scheduled first, so sometimes you may have to wait to run your job and it will get terminated after some amount of time. There are ways to cope with that, though: checkpoint your parameters frequently and make your training restartable from a checkpoint. There are tutorials available on the Colab website.

that was a good info, i will check it out. I just compare my computer speed vs coursera a task that coursera took 212 ms my computer took 8 s about 38 times faster

The problem with buying your own computer equipment is that it can be expensive and as soon as you buy it, it’s already out of date. And if it turns out not to be powerful enough, then you need to buy more. What if you decide you need to train an even bigger model a month from now? If you use an online service like Colab or AWS, then you may have to pay for it, but it’s way less costly than buying your own hardware. And then you also have the advantage that you leave the complexity of hardware purchasing to Google or Amazon. And you will have greater overall power at your disposal. I don’t know about the pricing model on Colab, but on AWS it’s definitely based on what you use.