Closed khalidcoding closed 1 year ago
Hi @khalidcoding, have you checked the sizes of the variables Mvs
and M_DeepGen
to see if they are the same? You can do this by running the commands size(Mvs)
and size(M_DeepGen)
on the Matlab prompt right after you get the error and see what is the result.
Also, was the image r_cube
cropped or modified before being passed to the DeepGUn
function?
Thanks
Hi @ricardoborsoi, yes I already checked the sizes of Mvs and M_DeepGen, Mvs has (224×3×4900) and M_DeepGen has (345×3×4900), Also the image r_cube hasn't been cropped or modified, "r_cube has (70×70×345) data size".
Hi @khalidcoding, there is some problem with the dimension of r_cube
, it should be 70x70x224 (it is the hyperspectral image, with dimension height by width by bands). This variable (which is the hyperspectral image) is loaded directly from the file data_ex1.mat
, provided in the repository:
>> load('data/data_ex1.mat')
>> size(r_cube)
ans =
70 70 224
Please try to compare your version of the code to the latest version of example1.m
in the repository to see if there were any changes to this variable, or to the contents of the file data_ex1.mat
.
Hello @ricardoborsoi, yes I noticed that I'm using another hyperspectral image data but the thing is when i use this particular r_cube I get a whole bunch of other errors as the picture below
thank you for your help, I will try harder with it and let you know the result. sorry for the late reply.
Hi @khalidcoding , if you are using a different hyperspectral image, there are a few things to consider:
Mvs
contains the ground truths for the endmembers, if this is not available for the image you are considering you might have to ignore the lines where it is used to evaluate the endmembers RMSE. M0
of size bands number of materials) for your new image, using the command M0 = vca(r,'Endmembers',P);
, where r
is the new hyperspectral image ordered as (bands pixels) and P
is the number of materials in the scene. Hi @ricardoborsoi , hope you're doing well. I couldn't fix this issue I have so I changed my data to the original one (the one you used ) and now this new error pops up and it's about using hdf5info and that 'vae_EM_idx1.h5' could not be open as shown bellow
knowing that the file is saved in the same folder, please if you could give some guidance to fix it I would appreciat it.
Hello @khalidcoding, this error is most likely caused by the inability to run the python
terminal command from Matlab, see the line system('python python/vae_keras_ems_train.py')
in the function DeepGUn/train_DeepGen_EM_model.m
. This is shown through the command not found: python
message.
Fixing it might depend on your operating system, but if you have Anaconda already installed and are still getting a "python not found" error, you basically have to "tell" Matlab where your python installation is in your system:
/Users/myusername/opt/anaconda3/bin/python
. setenv('PATH', [getenv('PATH') ':/Users/myusername/opt/anaconda3/bin'])
(substituting myusername
by the username/path in your case). system('echo $PATH')
in Matlab to check if python is now present in the path, if so you should be able to run python scripts using system("python ...")
in Matlab.Hello @ricardoborsoi , I don't actually have anaconda in mac mac book, I will try this guidance now and let you know the result, thank you. at first it was working well without anaconda I had only an error in matrix dimensions, now when I downloaded your code and data version, this error pops up, I don't know why. In 2. do I need to add this path to the matlab code path or matlab path in general ?
Good evening, I got this issue related to arrays have imcompatible sizes, please I tried fixing it but every time I get more errors, I know it's a simple error but I'm just new in learning matlab and coding, so if you could help me it will be much appreciate it.
thank you.