wzhshi / TIP-CSNet

The training codes, the training data, and some pre-trained models for my TIP paper "Image Compressed Sensing using Convolutional Neural Network".
43 stars 12 forks source link

Can you share the code snippet to train the whole net? #2

Open sunbingfeng opened 4 years ago

sunbingfeng commented 4 years ago

Hi,

I generated the imdb file using your default script, and wrote a script to train the network, but it failed.

So really appreciate it if you can share your training codes.@wzhshi

The code I used:

clc;
close all;
clear all;

run '.\matconvnet-1.0-beta25\matlab\vl_setupnn.m'

imdb = load('.\data\model_64_96_Adam\imdb.mat')
batch = 10;

net = cnn_CSNetPlus_init_dagnn();

[net, stats] = cnn_CSNetPlus_train_dag(net, imdb, batch);

The errors are as below:

Reference to non-existent field 'images'.

Error in cnn_CSNetPlus_train_dag (line 50)
if isempty(opts.val), opts.val = find(imdb.images.set==2) ; end

Error in CSNetPlus_train (line 14)
[net, stats] = cnn_CSNetPlus_train_dag(net, imdb, batch);

Thanks!

wzhshi commented 4 years ago

Hi, the starting function is cnn_CSNetPlus_experiments_dag.m. To use your own dataset, you just need to change the line 23 of the function cnn_CSNetPlus_init_dagnn.m. That is, You just need to change “net.meta.imdbPath = './data/model_64_96_Adam/imdb.mat'” to your own dataset path. Of course, you can also put your imdb file into the folder './data/model_64_96_Adam/’.

wzhshi commented 4 years ago

Hi, the starting function is cnn_CSNetPlus_experiments_dag.m. To use your own dataset, you just need to change the line 23 of the function cnn_CSNetPlus_init_dagnn.m. That is, You just need to change “net.meta.imdbPath = './data/model_64_96_Adam/imdb.mat'” to your own dataset path. Of course, you can also put your imdb file into the folder './data/model_64_96_Adam/’.

2020-07-19 14:17:43"sunbingfeng" notifications@github.com写道:

Hi,

I generated the imdb file using your default script, and wrote a script to train the network, but it failed.

So really appreciate it if you can share your training codes.@wzhshi

The code I used:

clc; close all; clear all;

run '.\matconvnet-1.0-beta25\matlab\vl_setupnn.m'

imdb = load('.\data\model_64_96_Adam\imdb.mat') batch = 10;

net = cnn_CSNetPlus_init_dagnn();

[net, stats] = cnn_CSNetPlus_train_dag(net, imdb, batch);

The errors are as below:

Reference to non-existent field 'images'.

Error in cnn_CSNetPlus_train_dag (line 50) if isempty(opts.val), opts.val = find(imdb.images.set==2) ; end

Error in CSNetPlus_train (line 14) [net, stats] = cnn_CSNetPlus_train_dag(net, imdb, batch);

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

sunbingfeng commented 4 years ago

Ok, I get it. Thanks a lot! @wzhshi