Hello,
I am attempting to run the scale tool through python so I can scale a generic model to multiple different subjects and run batch IK. I have set up the XML file with what I believe to be the correct file paths for the generic model maker, model scaler, and marker placer. However, when I try to use the scaletool.run() command I receive a 'No model specified' error. Where else would I specify the model if I have already filled in the model file path for each of three main sections of the scale tool? I have attached my xml file for reference.
Scale Tool Error in Python
- Aaron Henry
- Posts: 32
- Joined: Tue Dec 03, 2019 8:47 am
Scale Tool Error in Python
- Attachments
-
- ScaleSettingsCombinedSinglePelvis.xml
- (138.1 KiB) Downloaded 24 times
Tags:
- Thomas Uchida
- Posts: 1794
- Joined: Wed May 16, 2012 11:40 am
Re: Scale Tool Error in Python
I would first try moving all files to the same directory to confirm that everything runs properly. Next, you might try being consistent with whether you use "\" or "/" in the paths (you are currently switching halfway through the string). Finally, it's possible that OpenSim doesn't have access to the directory for some reason; you could try running in Admin mode to investigate.
- Aaron Henry
- Posts: 32
- Joined: Tue Dec 03, 2019 8:47 am
Re: Scale Tool Error in Python
Hi Thomas,
Thanks for your reply. I have moved everything to the same folder and have been able to load and edit the different files using the API. I have also changed my paths to consistently use "/" and even moved all files off of the google drive and onto my desktop in case there was an issue accessing cloud files. I am still running into the No model specified error even after running Spyder as an administrator. Is there another way of running in Admin mode to check for errors? Additionally, I have been able to successfully run the scale tool (both from the cloud and my desktop) through the GUI with the respective XML files. Any other insight would be appreciated.
Thanks,
Aaron
Thanks for your reply. I have moved everything to the same folder and have been able to load and edit the different files using the API. I have also changed my paths to consistently use "/" and even moved all files off of the google drive and onto my desktop in case there was an issue accessing cloud files. I am still running into the No model specified error even after running Spyder as an administrator. Is there another way of running in Admin mode to check for errors? Additionally, I have been able to successfully run the scale tool (both from the cloud and my desktop) through the GUI with the respective XML files. Any other insight would be appreciated.
Thanks,
Aaron
- Aaron Henry
- Posts: 32
- Joined: Tue Dec 03, 2019 8:47 am
Re: Scale Tool Error in Python
I removed all of the file paths to each of the individual files and was able to get the scale tool to at least run. It does not appear that a new scaled model file or additional scale related files are written, but I think this solved my original issue.
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Scale Tool Error in Python
Hi Aaron,
While we can't test your setup file as is, since we don't have access to your model & marker files, the names/paths of the files appear to be too long and contain spaces which could be problematic (it's good that you removed the mix of forward/backward slashes as some back slashes could be misinterpreted as escape characters, recommend staying with forward slashes exclusively). There're flags that control the writing of files e.g. that are not exposed as properties but are available to the API.
Please let us know if that works for you,
-Ayman
While we can't test your setup file as is, since we don't have access to your model & marker files, the names/paths of the files appear to be too long and contain spaces which could be problematic (it's good that you removed the mix of forward/backward slashes as some back slashes could be misinterpreted as escape characters, recommend staying with forward slashes exclusively). There're flags that control the writing of files e.g.
Code: Select all
scaleTool.setPrintResultFiles(true)
Please let us know if that works for you,
-Ayman
- Aaron Henry
- Posts: 32
- Joined: Tue Dec 03, 2019 8:47 am
Re: Scale Tool Error in Python
Hi Ayman,
I solved my issue by removing the full file path to each file (.xml,.osim,.trc,etc.) and only including the sub folder. In other words I cut out the 'C:\Users\User' in each file path and only used the subfolders that were part of the Python directory I was working in already.
I solved my issue by removing the full file path to each file (.xml,.osim,.trc,etc.) and only including the sub folder. In other words I cut out the 'C:\Users\User' in each file path and only used the subfolders that were part of the Python directory I was working in already.