-
Notifications
You must be signed in to change notification settings - Fork 88
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
Testing the network #3
Comments
As an end-to-end system, the trained decoder in itself is sufficient, i.e. you do not need encoder while testing as model trained as decoder contains both encoder and decoder in it.
|
Thank you for your reply! I am a beginner in torch fyi. I actually got that output when I just did a |
@codeAC29 Here is a quick script that I am writing without normalization, just to see an output by forwarding through the network. My end goal is to get a segmented output of the input image. Could you give me some hints on what I might be doing wrong?
Output:
When executing |
|
Thank you so much for your replies. I have not modified the decoder.lua. I have started the training on the decoder again. Following is the starting of the training session of the decoder. Could you please verify if something looks odd? In particular the command I'm using to start the session. For the CNNEncoder I am giving model-best.net from the encoder training session.
|
I just tried seeing the model in between the training session. Still getting the following:
I tried to look into the encoder network and it looks fine. Seems like for some reason this encoder part is not getting concatenated with the decoder. Could it be related to the CNNEncoder tag?
|
In your previous comment if you will see, the decoder is also displayed and there it is displayed correctly. It has 32 layers there. |
Hi @codeAC29. I did the git pull and trained the encoder and the decoder till max epoch 20. However, the trained decoder still shows:
I am training it on a g2.2x instance in amazon. I noted that the default --nGPU is 2. So I specified only 1 in this most recent training session. As you mentioned, I also verified that there were 32 layers at the start of the session this time. However, the end trained model doesn't give me the 32 layers. I did the following debugging:
Do you think the gpu_list stuff is messing things up? |
Are you using only one GPU and removed |
Yes. I'm using only one GPU. I tried some approaches: 1) specified --nGPU as 1 without modifying any of the code. 2) hardcoded model = nn.DataParallelTable(1):add(model:cuda(), 1). 3) Removed DataParallelTable fully from encoder and decoder. I'll now try the things you mentioned. |
Following is the output when I printed the model before the line you specified. I also replaced the torch.save line with your change. Now it seems like decoder is correctly getting the 32 layers. However, when I try to do a net:forward(image) on the decoder model, I get another error: Error when doing a net:forward(image) through the model:
Output when changed to torch.save(filename, model:clearState()) with --nGPU 1
|
I have a hunch on that error. I am mostly taking inspiration from test.lua to run the model on a set of images. In test.lua at this line I see that the tensor has 4 elements consisting of batch size, channel, width and height, whereas here I'm just trying to pass channel, width and height only. Do you think that might be it? |
Yes you need to pass a 4D tensor. So, just use a batch of 1 image. |
@codeAC29 Hi Abhishek, thank you again for your support. I am now able to forward through the model and get a 4D output tensor of 1x12x360x480. I looked through the values inside, for instance, output[1][1][2][3] gives 0.0053367093205452. I'm assuming these are log probablities (?). So to get pixel wise labelling like 1,2,3...instead of 0.005336, what kind of operation should I do (argmax?). Also, could you explain why torch.save(filename, model:clearState()) solved my problem with having an incomplete model? Thank you. |
Your final output will have
When you do |
Thank you! Closing the issue. |
Is there any available model out there to test ? |
Thank you @culurciello :) |
@culurciello Is this model trained on training set only? Or the images in validation set are also used to finetune the model? |
Hi I was able to successfully train the encoder and the decoder. I wanted to test the network with an image and am setting up a script in Lua. I am a little confused understanding the network as an end-to-end system. When I load the .net file from training session of the decoder, I see the following model:
However, when I load the .net file from the training session of the encoder, I see the model is much bigger. Am I suppose to pass the test image through the encoder and then connect the output of the encoder to the decoder?
Following is a snippet of how I'm loading the .net files.
The text was updated successfully, but these errors were encountered: