qureai/ultrasound-nerve-segmentation-using-torchnet

can not open unet_512_train_sgd_epoch_torchnet_1.t7> in mode

danieleewww opened this issue · 0 comments

this issue was fixed by create a saved_models directory under /data. Otherwise, the execution of main.lua will render the following error in which the training model could not be saved at all.

danieleewww@daniel-System-UbuntuGT950:~/torch/ultrasound-nerve-segmentation-using-torchnet$ th main.lua
Setting up data loader using ./data/train.h5
Data loader setup done!
{
optimMethod : "sgd"
trainBatchSize : 32
dataset : "train"
trainDataset :
{
__replacement : false
__sampler : function: 0x10660f30
__perm : LongTensor - size: 100
__size : 100
__dataset :
{
load : function: 0x1082de40
list : LongTensor - size: 4437
}
}
savePath : "data/saved_models/"
trainSize : 100
valDataset :
{
__replacement : false
__sampler : function: 0x107daee0
__perm : LongTensor - size: 25
__size : 25
__dataset :
{
load : function: 0x10661640
list : LongTensor - size: 1198
}
}
valSize : 25
valBatchSize : 32
cvParam : 2
model : "./models/unet.lua"
maxepoch : 250
}
Epoch : 1, Learning Rate : 1.00000
[==================== 4/4 ====================>] Tot: 3s873ms | Step: 1s291ms
/home/danieleewww/torch/install/bin/lua: cannot open </home/danieleewww/torch/ultrasound-nerve-segmentation-using-torchnet/data/saved_models/unet_512_train_sgd_epoch_torchnet_1.t7> in mode w at /home/danieleewww/torch/pkg/torch/lib/TH/THDiskFile.c:649
stack traceback:
[C]: in ?
[C]: in function 'DiskFile'
...e/danieleewww/torch/install/share/lua/5.2/torch/File.lua:385: in function 'save'
./machine.lua:132: in function 'saveModels'
./machine.lua:197: in function <./machine.lua:193>
(...tail calls...)
...ch/install/share/lua/5.2/torchnet/engine/optimengine.lua:122: in function <...ch/install/share/lua/5.2/torchnet/engine/optimengine.lua:67>
(...tail calls...)
./machine.lua:110: in function 'train'
main.lua:55: in function 'main'
main.lua:59: in main chunk
[C]: in function 'dofile'
...ewww/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: in ?
Time : 8.32288 | Training Dice Score : 0.04045 | Norm Ratio : 0.10308 | GradParam Norm : 9.67324 | Validation Loss : 0.02785 | Param Norm : 93.83880 | Validation Dice Score : 0.52000 | Training Loss : 0.08134 |