0
$\begingroup$

I am trying to use a wolfram script to analyse a large number of movie frames (script available here:https://community.wolfram.com/groups/-/m/t/2288529)

I am using the following code on the Windows cmd prompt:

wolframscript.exe -f script.wls folder_with_movie_frames output.json

When I was using the Mathematica trial version, this code worked fine and I would obtain the desired output (which is to say the output.json file).

In the meanwhile, I have purchased the permanent version of Mathematica. Note that, in the process, I uninstalled the software, and then reinstalled it.

Since then, the very same coding does not seem to work anymore. You may find here a copy of the workspace I am using.

I get the following error message:

AddHandler::shdw: Symbol AddHandler appears in multiple contexts {CURLLinkUtilities, Internal}; definitions in context CURLLinkUtilities` may shadow or be shadowed by other definitions.

Followed by:

Message occurred during file: C:\Program Files\WolframResearch\Mathematica\12.3\SystemFiles\Components\NeuralFunctions\Audio\SpeechRecognition\SpeechCases.m

In the end, nothing happens, no JSON file gets created.

On one occasion, for a reason I ignore (since I used the very same workspace), I got the same two error messages, followed by this one.

Done. The product exited because of a license error.

This time, a JSON file was indeed generated. Yet, after this attempt, it never worked again.

For more background details:

  • I am of course using an original Mathematica license (not a pirated one);
  • I do not have at my disposal another machine running Mathematica.

What should I do?

$\endgroup$
2
  • $\begingroup$ If the script worked before and the setup/files/script has not changed, then it should still work. If you have another machine running MMA on premises, then take your "workspace_folder" over there and try to run it. Mma installation doesn't seem like the problem here. I think the Mma software on your machine is working otherwise. Once you have clearly identified the problem (whether it is the script, the setup, read/write permissions, the machine), rephrase and shorten your question to put focus on the problem at hand. $\endgroup$
    – Syed
    Commented Sep 1, 2021 at 4:31
  • $\begingroup$ If you don't have other Mma installations nearby, you can zip your actual workspace_folder and load it onto Google Drive or One Drive and provide a link in your question. Leave a few images in the "film_folder" with the size not exceeing 0.5MB or perhaps a little more. I can only test on 12.2Win7 but this will open up more possibilities. $\endgroup$
    – Syed
    Commented Sep 1, 2021 at 5:51

1 Answer 1

0
$\begingroup$

You attached a wolframscript.exe file ( that I thought was redundant at first)

1st experiment with your version of wolframscript.exe in workspace folder

C:\Workspace films - For testing>wolframscript.exe -f script.wls film_folder xyz.json

AddHandler::shdw: Symbol AddHandler appears in multiple contexts {CURLLinkUtilities, Internal}; definitions in contex t CURLLinkUtilities` may shadow or be shadowed by other definitions. Message occurred during file: C:\Program Files\Wolfram Research\Mathematica\12.2\SystemFiles\Components\NeuralFunctions
Audio\SpeechRecognition\SpeechCases.m
Done.
^C

2nd experiment removing your exe file and using what's on my system path

C:\Workspace films - For testing>wolframscript.exe -f script.wls film_folder output.json

AddHandler::shdw: Symbol AddHandler appears in multiple contexts {CURLLinkUtilities, Internal}; definitions in context CURLLinkUtilities` may shadow or be shadowed by other definitions. Message occurred during file: C:\Program Files\Wolfram Research\Mathematica\12.2\SystemFiles\Components\NeuralFunctions
Audio\SpeechRecognition\SpeechCases.m
Done.
^C
C:\Workspace films - For testing>

This "Done" at the end of each experiment is coming from your script and Ctrl-C has to be pressed to get back to the prompt. It takes about 12 seconds per experiment for the script to run for these two images on my system. If you have thousands of images, scale this number and wait patiently. As a result two json files have been created. Comparing the two, there are many lines with numerical differences, but nothing significant.

enter image description here

output.json is 22422 lines, xyz.json is 22401 lines. The results for the two images are identical.

enter image description here

Suggestions

  1. Ignore the warning messages. These seem unimportant since audio processing is not happening here anyways.
  2. Run the script on a few test images and extract info to get an idea of the script's capabilities and runtime requirements.
  3. I think you have thousands of images in your actual folder and this may take 1 minute for every 4 to 6 images. This means you can be waiting for many hours for any results; i.e., if your system doesn't crash first.
  4. Since the resulting text files can be merged later, I suggest running your experiment in batches and be very organized with the file names or risk losing it all.

I hope this helps you.

$\endgroup$
3
  • $\begingroup$ Dear Syed, You are absolutely right, despite the error message, it actually does work with a bit of patience. In fact, on my side it was not even needed to press Control-C. The issue is when I reiterate the same operation with a larger number of photos: 1) If I use 10 pictures (total: about 3MB), it still works. 2) With a larger sample (+100MB, which is the whole point of my study), the system is not able to complete the task, and gives me an error message related to "license" and "registration". I guess this is another topic, so I am moving the conversation to a new question. $\endgroup$
    – HugoRD
    Commented Sep 2, 2021 at 8:12
  • $\begingroup$ I have a few postscript thoughts: 1) I think that this JSON data needs to somehow go into a database along with the names of the images, So you can develop the infrastructure for that. From there you can run queries. There is no need to run this script on thousands of images at the same time. 2) Ask the original researchers, may be they will give your more pointers. I thought initially that you were running this as a university project so I suggested that you change machines since it is possible to have more Mma licenses on premises/campus. Good luck to you. $\endgroup$
    – Syed
    Commented Sep 2, 2021 at 8:19
  • $\begingroup$ Thank you. I am in touch with the original researchers. They have been very responsive and very encouraging, but they used a mac system, and seemed unable to answer my technical queries related to Mathematica. It is a personal university project (I am a PhD student) but my university does not have access to Mathematica. I am on my own here. I have invested my own money on this software and I am really motivated to learn and complete the project :) $\endgroup$
    – HugoRD
    Commented Sep 2, 2021 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.