Comments (3)
Hello,
Unfortunately none of us own a windows machine so it will be hard for us to help troubleshoot this. We did not intend to support Windows in the first place.
We use pkg-config
to find the paths to the libturbojpeg
and opencv
libraries. You could craft your own setup.py
with the correct paths to these libraries.
Hope it helps :/
from ffcv.
I built ffcv successfully with my Windows 10 PC
This is the installation process I did.
Install opencv (https://opencv.org/releases/)
After install opencv, move to C:/opencv
Install libjpeg-turbo (https://sourceforge.net/projects/libjpeg-turbo/)
download libjpeg-turbo-x.x.x-vc64.exe, not gcc64
Install pthread (https://www.sourceware.org/pthreads-win32/)
I downloaded pthreads-w32-2-9-1-release.zip
After unzip, rename Pre-build.2 folder to pthread and move to C:/pthread
And install mingw.
We need to configure .pc file of above packages to find them with pkg-config.
pkg-config .pc files path: C:/msys64/mingw64/lib/pkgconfig
create and paste below files to pkg-config path
# opencv4.pc
prefix=c:/opencv/build
exec_prefix=c:/opencv/build
libdir=c:/opencv/build/x64/vc15/lib
includedir=c:/opencv/build/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 4.5.5
Libs: -Lc:/opencv/build/x64/vc15/lib -lopencv_world455
Cflags: -Ic:/opencv/build/include
# libturbojpeg.pc
prefix=c:/libjpeg-turbo64
exec_prefix=c:/libjpeg-turbo64
libdir=c:/libjpeg-turbo64/lib
includedir=c:/libjpeg-turbo64/include
Name: libturbojpeg
Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API
Version: 2.1.2
Libs: -Lc:/libjpeg-turbo64/lib -lturbojpeg
Cflags: -Ic:/libjpeg-turbo64/include
# pthread.pc
Name: Pthread
Description: Pthread
Version: VC2
Libs: -LC:/pthread/lib/x64 -lpthreadVC2
Cflags: -IC:/pthread/include
Now pkg-config can recognize opencv4, libturbojpeg, pthread.
In setup.py, add extension_kwargs = pkgconfig('pthread', extension_kwargs)
and mute extension_kwargs['libraries'].extend(['pthread'])
, like below.
# setup.py
...
extension_kwargs = pkgconfig('opencv4', extension_kwargs)
extension_kwargs = pkgconfig('libturbojpeg', extension_kwargs)
extension_kwargs = pkgconfig('pthread', extension_kwargs) # add this line.
# extension_kwargs['libraries'].extend(['pthread']) # mute this line.
...
In libffcv/libffcv.cpp remove dunder from dunder uint
in imdecode
// libffcv/libffcv.cpp
int imdecode(unsigned char *input_buffer, uint64_t input_size,
uint32_t source_height, uint32_t source_width,
unsigned char *output_buffer,
uint32_t crop_height, uint32_t crop_width,
uint32_t offset_x, uint32_t offset_y,
uint32_t scale_num, uint32_t scale_denom,
bool enable_crop,
bool hflip)
Finally, can build ffcv by following command without error.
python setup.py bdist_wheel
However, I haven't checked the operation of ffcv on my Windows PC yet.
from ffcv.
That's amazing. Feel tree to make a pull request if you are fine making this available to other users. In the meantime I will close this issue.
from ffcv.
Related Issues (20)
- Indexing HOT 1
- Changing Indices during training leads to much slower training HOT 2
- Memory Leak in Ffcv Loader? HOT 4
- Import error - libopencv_impgproc missing HOT 2
- Installation issues HOT 6
- Small bug (improvement suggestion) in the quickstart doc HOT 1
- stuck in the loader when using only cpu HOT 4
- Grayscale Image Datasets HOT 2
- Top-1 accuracy on ImageNet drops between runs -- only difference is FFCV HOT 2
- Large .beton files slow down or even freeze learning during loading [possible bug] HOT 2
- [General question] FFCV scope
- ModuleNotFoundError: No module named 'ffcv.compiler
- doubt about mutli-gpu train when use imagenet 4 gpus HOT 1
- Default num_workers is incompatible with SLURM
- Installing FFCV on CPU-only node HOT 1
- Exact performance improvement
- Unable to save anything in the Fields HOT 1
- Compression error causes performance drop
- Reuse memory?
- Installing ffcv fails HOT 1
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 ffcv.