-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix dimensions must agree -- error with old versions of Matlab #3
Comments
Hello, I have faced this error. But I can not run the demo.m because the model loaded does not replace. So how can I get the new model after replacing the line 59 and 60? Thank you! |
What do you mean by "the model loaded does not replace"? Could you please explain more what is the error message you got in Matlab? |
I mean that I just replace the code, but the model loaded in the demo.h is still the old one. |
Thanks for clarifying. No need to replace the model .. just replace the code and it should work. |
It seems that the problem is not in the model .. probably, it is related to the image itself. Do you mind to print out the size of Iy, diff_u and diff_v? Or if you can send me figure3.jpg. Thanks! |
Please replace Line 69 in WBmodel.m and Line 69 in WBmodel_GPU.m with the following one:
|
Could you please refer to the part that you think it is a bug? What is the error message you got? |
After replacing Line 69 in WBmodel.m and Line 69 in WBmodel_GPU.m, there are still some errors shown above. |
thanks for sharing. I guess the problem is about broadcasting .. let me have a look and try to make things work for you. |
OK,thank you for your guidance, I will also read the code carefully after my work. |
Replace line 92 in WBmodel.m and line 92 in WBmodel_GPU.m with the following code: Please let me know if you still have a problem with your Matlab version. |
The code is running Ok, thanks for your guidance! |
If you faced the following error in Matlab:
Please replace the lines 59 and 60 in WBmodel class and the lines 59 and 60 in WBmodel_GPU class with the following lines:
diff_u=abs(repmat(Iu,[1,size(A,2)])-repmat(A,[size(Iu,1),1]));
diff_v=abs(repmat(Iv,[1,size(A,2)])-repmat(A,[size(Iv,1),1]));
Please replace Line 69 in WBmodel.m and Line 69 in WBmodel_GPU.m with the following one:
hist(:,:,i)=(repmat(Iy, [1, size(diff_u,2)]) .* double(diff_u))'*double(diff_v);
Lastly, please replace line 92 in WBmodel.m and line 92 in WBmodel_GPU.m with the following code:
mf = sum(repmat(weightsH,[1, size(obj.mappingFuncs,2)]) .* obj.mappingFuncs(idH,:),1);
The old Matlab versions don't offer this broadcasting operation. In the new versions of Matlab, this
repmat
operation is automatically applied when the first/second operand is a single row vector and the second/first operand is a single column.The text was updated successfully, but these errors were encountered: