I was trying to implement Text Summarization outside the portal on my machine. I am able to set it up to run on my Mac successfully. But when I wanted to use my own data directories I got into the problem. The issue occurred with Cell 42 (2 cells down UNQ_C8). The code is:
I am not familiar with how any of that code works, but there’s a pretty obvious thing to check:
My guess is simply that you are not properly understanding where the “current working directory” is for the various stages there. If you want to do things in your own environment, then you also need to develop the skills to solve this type of problem on your own. At the point that you get the failure, stop and run the following linux “find” command to figure out where the new model file actually got created:
find ~ -name model.pkl.gz -print
It’s probably getting created someplace different that you didn’t expect. The output of the find command should point out where it is.
I forgot to mention that I was running it on Mac. When I said “current working directory”, I meant the directory that is shown when you run the command ‘pwd’ in the terminal.
Secondly, I deleted the file model.pkl.gz in the pwd and the script threw file not found error. So the model was created in ‘~/model’ directory but the script was looking for the file in the pwd folder.
I verified it through ‘finder’ also that.
So I hope I understand what I am working with. And regarding developing skills to solve the problem on my own, I have never worked in AI earlier but had been working with computers, both Windows and Unix, for about 40 years.
I have not yet been able to install trax on my Mac. Did you build from source? Or, which channel did you find to install from? x86 or arm ?
As far as I can tell, the code expects to read the model.pkl.gz from the same directory the Jupyter notebook was launched from. In the archive I downloaded there is no model subdirectory. Unfortunately my subscription has ended so I can’t access the Coursera env and because of my trax hard stop I can’t run locally either.
btw as far as I can tell from the trax documentation, the init_from_file function loads a predefined model into memory, but does not write to disk. That requires model. save_to_file (). So if you successfully deleted the pretrained model’s model.pkl.gz file in the previous line, then you’re out of luck. I think the only reason this code ever ran is that there is no /model subdirectory so the !rm commend was a no op.
Coursera recommended to use Trax ver 1.3.9 (as mentioned in the C3-W1-Lab1). So I have been using that. From the link you posted, it seems a ver earlier to 1.3.7 had resolved the issue. On my Anaconda UI, it doesn’t give any option to install another version. So I will have to do some research to do that.
I use miniconda from the command line, so no suggestions about Anaconda UI, sorry. Pretty confident pip uninstall can remove specific packages, then use install with a specific version to match trax level
I have similar errors when implementing this code locally: it seems that none of the trax versions is compatible and I’ve tried 1.3.1 as mentioned in the assignments from the previous courses and 1.3.7, 1.3.9 and latest 1.4.1. Much appreciated If someone resolves this and posts it