CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Load module in python

Open Arminea opened this issue 9 years ago • 16 comments

Hi, I'm trying load a model in python code via load_model() function. My model is not saved using save_model() python function, it's saved using brainscript. When I try to load my previously created model I'm getting this error Value error: The convolution map should have at least as many axes as the shape of the input it operates on.

Can I make it work somehow?

Arminea avatar Jan 24 '17 19:01 Arminea

Hi,

Which version of CNTK are you using? Is it possible to share your brainscript file?

ebarsoumMS avatar Jan 25 '17 17:01 ebarsoumMS

Sure thing. Here's link to my files on OneDrive https://1drv.ms/f/s!As_qGuBAm_dbiNldCItxglz_ELfz1A. I downloaded and built the project yesterday, so the last version, but the model is created on October. Could that be a problem?

Arminea avatar Jan 25 '17 18:01 Arminea

Thanks, can you share the saved model also?

ebarsoumMS avatar Jan 25 '17 22:01 ebarsoumMS

Yes, https://mega.nz/#F!mo9RCSxJ!d6fuR5jSTTf9HCW9nulktQ. There** are two models, one from September and one from yesterday. I tried to make a new model just for sure but the error is still the same.

Arminea avatar Jan 26 '17 08:01 Arminea

I get the same thing with the c++ interface (reported in #1179)

dmagee avatar Jan 26 '17 18:01 dmagee

Can you share them from a location in which I can download them for free? Such us Onedrive, googledrive...etc?

ebarsoumMS avatar Jan 26 '17 18:01 ebarsoumMS

I's sorry. Here's an other link to models. https://drive.google.com/drive/folders/0B2rkLUa399G-WVZtNkstclZ0d28?usp=sharing

Arminea avatar Jan 26 '17 18:01 Arminea

@Arminea Thanks for sharing the model. There was a bug which is now fixed in master. But you might have to wait until the next release, if you do not want to build Python wheels from master by yourself.

Sorry for the inconvenience.

zhouwangzw avatar Feb 02 '17 14:02 zhouwangzw

@zhouwangzw It works perfectly :) Thank you. A have another little question. I wanted to find output node in my model (https://github.com/Microsoft/CNTK/wiki/Evaluate-a-saved-convolutional-network so I printed them with

for index in range(len(z.outputs)):
  print("Index {} for output: {}.".format(index, z.outputs[index].name))

But my output does not contain Index 2 as it is in the tutorial.

Index 0 for output: ce.
Index 1 for output: errs.

Should I change something in my brain script? The link to my files is above from 10 days ago.

Arminea avatar Feb 04 '17 21:02 Arminea

It seems that your model does define any output node. Please define "outputNodes = (xxx) " in your config.

zhouwangzw avatar Feb 06 '17 14:02 zhouwangzw

@zhouwangzw It works now. But my only change was OutputNodes = o1 -> outputNodes = (o1) Is this change so significant?

Arminea avatar Feb 06 '17 15:02 Arminea

@Arminea yes, Brainscript is case sensitive. https://github.com/Microsoft/CNTK/wiki/Deal-with-the-'No-Output-nodes-found'-error

zhouwangzw avatar Feb 06 '17 15:02 zhouwangzw

@zhouwangzw Now I feel really stupid :D Thanks again. Closing issue.

Arminea avatar Feb 07 '17 11:02 Arminea

@zhouwangzw Hi, sorry for opening this issue again but is it possible that something went wrong with the Linux version? On Friday, I updated to beta 10 version and I'm getting the same error. If I build the project for windows myself it's fixed.

Arminea avatar Feb 15 '17 07:02 Arminea

@Arminea If I remember correctly, the fix is available in Beta 11. Could you please try with the latest Beta 11?

zhouwangzw avatar Feb 15 '17 07:02 zhouwangzw

@zhouwangzw You were right. It is in Beta 11 release :)

Arminea avatar Feb 15 '17 09:02 Arminea