Any idea why I am getting the following error in Mathematica 12 running a BERT example?
input = "Hello world! I am here"; embeddings = NetModel["BERT Trained on BookCorpus and English Wikipedia Data"][ input]; NetChain::invindata3: Data supplied to port "Input" could not be encoded; "Function" encoder did not produce an output that was a n*2 matrix of integers between 1 and 30522.![enter image description here][1]
Hi,
I just checked an example from above using Mathematica 12 / Win 10 64bit. While running the code example the first time Mathematica automatically executed updates and eventually produced the result as expected by Rohit. See the notebook attached.
Regards
Walter
Can you try this? PacletUpdate["NeuralNetworks"] Quit and retry?
Hi Tuseeta,
I tried your suggestion, it did not solve the problem. Same error message.
Do you have any other suggestions to try and fix this problem?
BTW it works fine on 12.1 prerelease version 12.1.0 for Mac OS X x86 (64-bit) (December 21, 2019)
Thanks, Rohit
It works for me, could you please ResourceRemove the ResourceObject and re-download the model?
In[1]:= input = "Hello world! I am here"; Dimensions@ NetModel["BERT Trained on BookCorpus and English Wikipedia Data"][ input] Out[2]= {8, 768}