Skip to content
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

run models #14

Closed
sahooora opened this issue May 31, 2020 · 56 comments
Closed

run models #14

sahooora opened this issue May 31, 2020 · 56 comments

Comments

@sahooora
Copy link

How can we run the models?
I want to run vae model but It's not specified how!

@kartikdutt18
Copy link
Member

Hi @sara-hoseininasab, This repo is undergoing restructuring right now, so that portion was edited in the readme. Sorry about that. We do have a completely working repository here. It has a make file and scripts to download datasets and run models as well. Here is the VAE example.

@sahooora
Copy link
Author

Hi @sara-hoseininasab, This repo is undergoing restructuring right now, so that portion was edited in the readme. Sorry about that. We do have a completely working repository here. It has a make file and scripts to download datasets and run models as well. Here is the VAE example.

Thanks!
After running mnist_vae_cnn I got this error: [FATAL] Cannot open file './../data/mnist_full.csv'.
I should mention that before running it I executed download_dataset.py in the tools directory.

@kartikdutt18
Copy link
Member

Can you check that outside vae directory there is a data folder with mnist_full.csv?
Regards.

@sahooora
Copy link
Author

Can you check that outside vae directory there is a data folder with mnist_full.csv?
Regards.

There doesn't exist mnist_full.csv in the data directory. Just mnist_test.csv and mnist_train.csv are included in this directory.

@kartikdutt18
Copy link
Member

Hmm, Let me try replicating the issue.

@sahooora
Copy link
Author

Hmm, Let me try replicating the issue.

Thanks!

@shrit
Copy link
Member

shrit commented May 31, 2020

@kartikdutt18 I do not remember what there was in mnist_full.csv. I can understand from the name that it merges both of the train and test files.
@sara-hoseininasab You can replace mnist_full.csv by mnist_train.csv or merge manually both file and create a mnist_full.csv

@kartikdutt18
Copy link
Member

Right, I am facing electricity outage here, Most probably its mnist_train or mnist_all. Once I'm back, I'll try to find out what was there in the file.

@shrit
Copy link
Member

shrit commented May 31, 2020

@kartikdutt18 I will handle it, no worries.

@kartikdutt18
Copy link
Member

@shrit, Awesome! Thanks a lot

@shrit
Copy link
Member

shrit commented May 31, 2020

@kartikdutt18 I open a pull request here mlpack/examples#92
Still, during the execution, I had this issue: mlpack/examples#84

@kartikdutt18
Copy link
Member

Hmm, Let me look into that now.

@kartikdutt18
Copy link
Member

Hey @shrit, I just downloaded all the datasets. I also got mnist_full.csv in my datafolder.

@shrit
Copy link
Member

shrit commented May 31, 2020

Hmm, are you sure this is not an old one?

@kartikdutt18
Copy link
Member

Yeah looks that way. Sorry about that.

@kartikdutt18
Copy link
Member

Still, during the execution, I had this issue: mlpack/examples#84

I am able to fix this issue. Another thing is mnist_train has one extra labels column. We also need to drop that.

@shrit
Copy link
Member

shrit commented May 31, 2020

@kartikdutt18 You meant the first column as parsed as in this line https://github.com/mlpack/examples/blob/fbce4998c09abe433c42f2e1519df1b9c94aba5f/mnist_simple/mnist_simple.cpp#L76
Or there is another one?

@kartikdutt18
Copy link
Member

Right this one, Labels are not needed vae so maybe mnist_full was the csv with train without labels.

@sahooora
Copy link
Author

@kartikdutt18 I do not remember what there was in mnist_full.csv. I can understand from the name that it merges both of the train and test files.
@sara-hoseininasab You can replace mnist_full.csv by mnist_train.csv or merge manually both file and create a mnist_full.csv

@shrit Thanks.
I replaced mnist_train.csv by mnist_ful.csv and I got this error:
[FATAL] The output width / output height is not possible given the other parameters of the layer.

terminate called after throwing an instance of 'std::runtime_error'

@shrit
Copy link
Member

shrit commented May 31, 2020

@kartikdutt18 Exactly, in this case, I will remove it using Armadillo from inside mnist_vae.
@sara-hoseininasab we are working on this issue, you need to remove the first columns of this dataset using armadillo.

@kartikdutt18
Copy link
Member

@sara-hoseininasab, The padding needs to be valid in transposed layer. Earlier I think boost visitors took care of that but now we need to specify it manually. I'll open a PR shortly to fix that.

@sahooora
Copy link
Author

armadillo

@kartikdutt18 Exactly, in this case, I will remove it using Armadillo from inside mnist_vae.
@sara-hoseininasab we are working on this issue, you need to remove the first columns of this dataset using armadillo.

@shrit I am completely new in this scope. Could you please tell me how can I remove the first columns of the dataset using armadillo?
regards

@kartikdutt18
Copy link
Member

I think you can add the following line :

fullData = fullData.rows(1, fullData.n_rows - 1);

at line 65.

@sahooora
Copy link
Author

I think you can add the following line :

fullData = fullData.rows(1, fullData.n_rows - 1);

at line 65.

It should be added in mnist_vae_cnn.cpp file, am I right?
I did it but I still get the same error.

@kartikdutt18
Copy link
Member

Right, To fix that error you need to make the following change :

// Add the first transposed convolution(deconvolution) layer.
    decoder->Add<TransposedConvolution<>>(
        24,  // Number of input activation maps.
        16,  // Number of output activation maps.
        5,   // Filter width.
        5,   // Filter height.
        1,   // Stride along width.
        1,   // Stride along height.
        0,   // Padding width.
        0,   // Padding height.
        10,  // Input width.
        10,  // Input height.
        14,  // Output width.
        14,
        "valid"); // Output height.

    decoder->Add<LeakyReLU<>>();
    decoder->Add<TransposedConvolution<>>(16, 1, 15, 15, 1, 1, 1, 1,
        14, 14, 28, 28,"valid");

Replace the similar layers with this one.

@sahooora
Copy link
Author

Right, To fix that error you need to make the following change :

// Add the first transposed convolution(deconvolution) layer.
    decoder->Add<TransposedConvolution<>>(
        24,  // Number of input activation maps.
        16,  // Number of output activation maps.
        5,   // Filter width.
        5,   // Filter height.
        1,   // Stride along width.
        1,   // Stride along height.
        0,   // Padding width.
        0,   // Padding height.
        10,  // Input width.
        10,  // Input height.
        14,  // Output width.
        14,
        "valid"); // Output height.

    decoder->Add<LeakyReLU<>>();
    decoder->Add<TransposedConvolution<>>(16, 1, 15, 15, 1, 1, 1, 1,
        14, 14, 28, 28,"valid");

Replace the similar layers with this one.

@kartikdutt18 Thank, the previous error has been solved. But I get the new one:
error: subtraction: incompatible matrix dimensions: 784x28 and 59999x28
terminate called after throwing an instance of 'std::logic_error'
what(): subtraction: incompatible matrix dimensions: 784x28 and 59999x28
Aborted (core dumped)

@shrit
Copy link
Member

shrit commented May 31, 2020

784x28 is the size of the older mnist_full matrix.
@kartikdutt18 I do not know how VAE works in detail, but the neural models inside seem to be tailored to the old dataset.

@kartikdutt18
Copy link
Member

Right using mnist_full.csv doesn't give this error.

@sahooora
Copy link
Author

sahooora commented Jun 8, 2020

@kartikdutt18 Any news about the vae?

@kartikdutt18
Copy link
Member

In the source of mlpack, the parameter error is fixed. The only error left is segmentation fault. I'll try to find why that happens in the next couple of days.

@mlpack-bot
Copy link

mlpack-bot bot commented Jul 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

@mlpack-bot mlpack-bot bot added the s: stale label Jul 8, 2020
@shrit
Copy link
Member

shrit commented Jul 8, 2020

keep open

@mlpack-bot mlpack-bot bot removed the s: stale label Jul 8, 2020
@mlpack-bot
Copy link

mlpack-bot bot commented Aug 7, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

@mlpack-bot mlpack-bot bot added the s: stale label Aug 7, 2020
@rcurtin
Copy link
Member

rcurtin commented Aug 7, 2020

Just wanted to check in @shrit and @kartikdutt18, do you think that we have resolved this issue? Or is there work we still need to do to be able to run these models?

@mlpack-bot mlpack-bot bot removed the s: stale label Aug 7, 2020
@kartikdutt18
Copy link
Member

Hey @rcurtin, There is partial fix made in mlpack/mlpack#2436. However, The VAE Model still segfaults. Since this has more to do with the examples repo, we also have an issue here.

@rcurtin
Copy link
Member

rcurtin commented Aug 8, 2020

No problem @kartikdutt18, I just wanted to check if the issue was still relevant. I suppose we should leave it open until mlpack/examples#84 is fixed, then we can propagate that fix to this repository?

@kartikdutt18
Copy link
Member

Sure, Sounds good to me.

@mlpack-bot
Copy link

mlpack-bot bot commented Sep 7, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

@mlpack-bot mlpack-bot bot added the s: stale label Sep 7, 2020
@shrit
Copy link
Member

shrit commented Sep 7, 2020

Keep open

@mlpack-bot mlpack-bot bot removed the s: stale label Sep 7, 2020
@mlpack-bot
Copy link

mlpack-bot bot commented Oct 7, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

@shrit
Copy link
Member

shrit commented Jun 11, 2021

Closing this issue as it has been resolved by #156

@shrit shrit closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants