fastText -autotune-validation not working - fasttext

I am trying to use the autotune-validation command to check the f1 score of a dataset I am working in.
I tested fastText in two different machines (Ubuntu and MAC), but I got the following error:
Unknown argument: -autotune-validation
The following arguments are mandatory:
-input training file path
-output output file path
The following arguments are optional:
-verbose verbosity level [2]
...
I tried to read the documentation, but according to the fastText website, this command should work fine.
./fasttext supervised -input commits.train -output commits -autotune-validation commits.valid
I expected the -autotune-validation command to work fine as described here

Related

Why does my 7zip command now get a "Cannot find archive name" error

Without problems I've been using the following 7zip command on Appveyor CI in a .bat file using 7zip 21.07 running on Windows Server 2019, and also with earlier Windows Server & 7z versions:
7z -owin-oclcpuexp-2021.12.9.0.24_rel e win-oclcpuexp-2021.12.9.0.24_rel.zip
The identical command in a Powershell script on GitHub Actions CI using 7zip 22.01 running on Windows Server 2022 gets this error:
7-Zip 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
Command Line Error:
Cannot find archive name
I've tried running it from cmd.exe
cmd.exe /C 7z -owin-oclcpuexp-2021.12.9.0.24_rel e win-oclcpuexp-2021.12.9.0.24_rel.zip
and also tried putting the command before the switch
7z e win-oclcpuexp-2021.12.9.0.24_rel.zip -owin-oclcpuexp-2021.12.9.0.24_rel
but I still get the error. win-oclcpuexp-2021.12.9.0.24_rel.zip is present in the current directory and has the expected size.
EDIT: For the sake of completeness I should say that the name is taken from an environment variable. The actual command has $env:OPENCL_SDK_NAME instead of win-oclcpuexp-2021.12.9.0.24_rel. In the .bat file the reference was, of course, %OPENCL_SDK_NAME%. I have verified that the variable has the expected value.
Why did this command stop working?
I was able to reproduce the problem on my local Windows box so with the help of ProcessMonitor, thanks Lex Li, I figured out what was happening. It's all down to Powershell handling of variable expansion. As a relative newbie to PS and long time bash/sh user I find PS's behavior surprising.
The actual command I had was
7z -o$env:OPENCL_SDK_NAME e $env:OPENCL_SDK_NAME.zip
I also had a preceding curl command using the same env. var. Because this worked it helped mask the issue.
curl.exe -s -S -L -O $env:OPENCL_SDK_HOME/$env:OPENCL_SDK_NAME.zip
So what is it? There are actually 2 problems:
With -o$env:FOO the variable is not expanded so the application sees exactly -o$env:FOO.
When seeing $env:FOO.zip PS substitutes an empty string, hence the Cannot find archive name error. I would never have spotted this without ProcessMonitor as the similar expansion in thecurl command was working. It turns out that PS does expand the variable in the case of foo/$env:FOO.zip. Utterly bizarre.
My fix is to add quotes around the variables. For safety I added them to the curl command as well. I don't know if there are other better ways of fixing this.
curl.exe -s -S -L -O "$env:OPENCL_SDK_HOME/$env:OPENCL_SDK_NAME.zip"
7z -o"$env:OPENCL_SDK_NAME" e "$env:OPENCL_SDK_NAME.zip"

Simulink RSIM target does not load new solver options

I'm stuck up using RSim target options.
I've created an .exe from a Simulink model "my_model" using RSim target.
Now my aim is to run this .exe and control the solver options using a .mat file.
I am trying to run the following command on CMD:
my_model.exe -i input.mat -tf 10 -o output.mat -S solver_options.mat
But the output.mat file of the model does not correspond to the sampling time I've provided in sover_options.mat.
I am following the inputs arguments provided by RSim, as shown below:
It seems that RSim is not reading new solver_options parameters.
My solver_options.mat file is provided below:
Could anyone help me, please?

Command 'bison name.y' doesn't work but not give out any error. system path correctly set up

I'm trying to run the command bison file_name.y from PowerShell, but it does not work. the command seems to be executed by the shell in fact the shell returns to ask for input but does not produce any output. I also tried the command bison file_name.y -d but I got the same result. I have checked the system variables and are correctly set. In fact, flex works correctly, for which I followed the same procedure.

error with the mex command -g (no optimization)

I am trying to mex a file in a script. The C file which has to be mexed is generated in one of the previous steps of the script before it is mexed.
When I use the below line in the script, everything works fine and the script runs successfully.
mex (strcat(component_name,'_s_func','.c'));
but when I add the same line below with
mex -g (strcat(component_name,'_s_func','.c'));
it gives me the error
C:\PROGRA~2\MATLAB~1\BIN\MEX.PL: Error: '(strcat(component_name,_s_func,.c))' not found.
Any idea why its not able to find the same file while using -g while it can find it when using without -g option?
The problem with your statement is that with the syntax
mex -g [...]
MATLAB assumes you are calling mex with the string arguments '-g' and '[...]' so it assumes that your file is called (strcat(component_name,'_s_func','.c')) and does not execute the command.
You can either use the solution you posted with eval, as that way you again call it with the strings '-g' and 'filename.c'. Another possibility would be to use the syntax
mex('-g',strcat(component_name,'_s_func','.c'));
because that way the command strcat is really executed before calling mex.
--
This is the same behavior as e.g. with clear. As you might know, the following statements are equal:
clear a b c
clear('a','b','c');
ok its possible to do this with eval command
file_name=(strcat(component_name,'_s_func','.c'));
eval(['mex -g ',file_name]);

Getting error in command line in Tesseract in Windows

I am following this documentation-https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3
I am trying to make a font for my language using this command-
training/ text2image --text=training_text.txt --outputbase=bn.Boishakhi.exp1 --font=Boishakhi --fonts_dir=C:\
I am getting this error
"Training is not recognized as external or internal command", on windows xp sp3 command line.
I am also having another problem.I ran tesseract successfully in windows xp sp3(English default traindata) but I cannot run it from command line to generate output in Windows 7 and 8.1. The commands I used are as follows:
cd C:\
cd Program Files
cd Tesseract-OCR
tesseract C:\Document.tif output -l eng
Please help.
I tried to change /(slash) to \ (backslash) but now the new error is "Cannot find the path specified"
As far as running in windows 7 or 8.1 is concerned, the error is "cannot create output file output.txt"
The first message means that the executable training was not found on the path. If the required executable was text2image then the space should be removed and the correct directory-separator used. \ separates directories in Windows; / introduces switches.
So training\text2image... should cure the problem, provided text2image is an executable found in training which is a subdirectory of whatever is the current directory, or you could use an absolute path, "C:\wherever\you have installed\tessteract\training\text2image" - and "note the quotes" that are required if the path to the name includes spaces (optional otherwise.)
As for your second question, you have unaccountably provided no information about any error messages you received, or how the system responded, so any response will be a guess. It may have something to do with the default protected status of the root directory C:\ and it may not. Please edit the question to include the error message or run report.