sebastianvitterso / master-sau

Sau og master
GNU General Public License v3.0
6 stars 2 forks source link

Training your model with four channels #5

Open MehrsaMashhadi opened 1 week ago

MehrsaMashhadi commented 1 week ago

Hello, I hope you are doing well. how can I train your model with my data? I ran the yolo_four_channel.py script, but it doesn't seem to be working.

sebastianvitterso commented 1 week ago

Hi! It's been two years since I looked at the code last, so I can't really give a tutorial off the top of my head.

If I remember correctly, you need to set up the data folder like we've shown in the readme, with images and annotations, and then by checking out the four-input branch, it should work.

What problems are you seeing?

MehrsaMashhadi commented 1 week ago

@sebastianvitterso Thank you so much for your prompt response. I figured out how to run the code. However I got this error: "raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'FourInputModel' object has no attribute 'head'" Screenshot 2024-09-25 133245 This is the part that I am getting the error.

sebastianvitterso commented 1 week ago

Ah, sorry, I don't recall what the issue could be in this case. Could you check which versions of e.g. torch and torchvision you have installed (run pip freeze to see)? Might be that our requirements.txt using >= on most dependencies causes it to allow higher major versions, and that again may cause problems with breaking changes. Worth checking. If so, you should be able to specify which version of those packages you want to use by installing them manually (something like pip install -Iv torch==1.7.0 etc. (explanation)).

Hope that resolves it.

If the issue is tied to the code, I must apologize, but I don't think I can recall the specifics of this after two years :D