Comments (6)
I also tried to make the HCLG.fst on Windows. The script ran smooth and HCLGa.fst could be composed by OpenFst until some Kaldi's internal FST utility was run:
'C:\Users\kaldi\kaldiwin_vs2017_OPENBLAS\x64\Debug\add-self-loops.exe' --self-loop-scale=1.0 --reorder=true tdnn_7q_mxr_1/final.mdl tdnn_7q_mxr_1/graph_ctf/HCLGa.fst
ERROR: VectorFst::Read: Read failed: standard input
ERROR: VectorFst::Write: Write failed: standard output
ERROR (add-self-loops.exe[5.5-win]:main():c:\kaldi\src\bin\add-self-loops.cc:109) add-self-loops: error writing FST to standard output
ERROR (add-self-loops.exe[5.5-win]:main():c:\kaldi\src\bin\add-self-loops.cc:109) add-self-loops: error writing FST to standard output
I guess there are some mismatch of Kaldi's VectorFst type or IO process which I still not figure out.
from openfst.
from openfst.
Sorry I couldn't find a simple enough way to reproduce the problem and I also suspect that most of the problem lies in Kaldi's window build.
But I've discovered some problem when reading VectorFst.
When reading the header, it crashed when retrieving the arc type (which in this line I think it should be hdr->ArcType()?).
When I commented out those involving Arc::Type(), the header could be read. But it crashed again when adding state. Maybe that my code missed something in using the Fst template?
from openfst.
It really looks like something, somewhere (sorry, it's hard to be more specific) is writing binary files in text mode. There is no difference on Linux, but on Windows this may turn the \n
(a binary byte with the hex value 0A) into the sequence \r\n
, 0C 0A. Since you are seeing the problem in header, find a port of hexdump (cygwin has one; there is an independent Windows exe) or just open the file in VS (dropdown on the Open button. Open with, Binary editor) if the FST file is not extra large, and look for this sequence in header.
If you are passing an istream to Kaldi or FST functions, do not forget ios::binary
. I am pretty sure that all Kaldi functions that create streams internally do that, but if passing streams to them, be aware of this, ehm, feature! From experience, I've never had a problem exchanging FST files between Windows and Linux. This is not to say there is not a possible bug--of course it's always a possibility; just to let you know this generally works flawlessly.
from openfst.
I checked and it seems that the header does not contain 0C 0A. It turns out that the header could be read.
The problem is that when I read the VectorFst using VectorFst<StdArc> *fst = VectorFst<StdArc>::Read(ki.Stream(), ropts);
, there is some problem with the implementation constructor at
std::unique_ptr<VectorFstImpl<S>> impl(new VectorFstImpl());
The StdArc class or the VectorState constructed from it somehow could not be passed to the template, such that when retrieving Arc::Type() or Weight::Type() of the new impl it would crash.
As the new impl object is independent of the content of my fst, I think there maybe other issues. I'm still finding ways to work around this. Thanks if you could offer any suggestions.
from openfst.
I found that it's my own mistakes again. Thanks for all your previous advice. This windows port of OpenFst is magnificent and crucial for my work. Many thanks again!
from openfst.
Related Issues (20)
- Feature request: Publish package on chocolatey HOT 4
- stdout newline conversion of binary data HOT 13
- About the license of this repo HOT 2
- Building openfst and getting 36 errors, Please help me HOT 2
- Build errors on vector-fst.h line 611 when using Visual Studio 14 2015 HOT 3
- Cannot find source file when building from source with Cmake HOT 9
- Error reading Kaldi's GrammarFst HOT 5
- kkm: Bring the upstream up to date HOT 1
- Implement memory-mapped files
- Build ngram and other extensions HOT 4
- Proposed fixes for building with CMake and Clang-cl on Windows with HAVE_BIN=OFF HOT 7
- Access denied: Unable to start the program .../ALL_BUILD HOT 1
- Can't run on windows-xp HOT 1
- Cannot open include file: 'dlfcn.h': No such file or directory HOT 1
- OpenFST 1.8.0 port HOT 2
- Cross compile error when using mingw. HOT 15
- openfst DLL LoadLibrary stuck HOT 1
- Please make a release
- ["-Wno-sign-compare", Wno-unused-local-typedefs] dont work in visual studio compiler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfst.