MichalBusta / DeepTextSpotter

285 stars 101 forks source link

no module named cmp_trie #44

Open 19931991 opened 6 years ago

19931991 commented 6 years ago

Hi , thanks for your code ! I have two prolems : 1、I modify the train.py image and add my path of data in the train.py , run python train.py ,but it displays that no module named cmp_trie 。 I used the standard caffe , is it caused by the standard caffe ? 2、my train_list and valid_list are as follow: image image are they right ? @MichalBusta

MichalBusta commented 6 years ago

On 06/14/2018 08:28 AM, 19931991 wrote:

Hi , thanks for your code ! I have two prolems : 1、I modify the train.py image https://user-images.githubusercontent.com/28551961/41394872-26658b24-6fde-11e8-900c-f946305e5ad4.png and add my path of data in the train.py , run python train.py ,but it displays that no module named cmp_trie 。 I used the standard caffe , is it caused by the standard caffe ?

you need exact version of caffe -  step 2 in install instructions. the error you get is because of - step 3

2、my train_list and valid_list are as follow: image https://user-images.githubusercontent.com/28551961/41395121-1f57b3e2-6fdf-11e8-8a1f-79df39cd9ad8.png image https://user-images.githubusercontent.com/28551961/41395141-345961d2-6fdf-11e8-86b2-dd486d4796ed.png are they right ? @MichalBusta https://github.com/MichalBusta

no, see https://github.com/MichalBusta/DeepTextSpotter/issues/39

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichalBusta/DeepTextSpotter/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AD6jsEQ5i7X15VsfUl0QDlnv4Ngmp6ZYks5t8gKkgaJpZM4UnYNb.

19931991 commented 6 years ago

Thanks for your reply !

vinodhian commented 6 years ago

Hi, I have compiled and install caffe as you have mentioned. And i have also ran the make command from the project source folder(~/DeepTextSpotter/)

[Tue Jun 26]:build (master)$ make Scanning dependencies of target trie_py [ 25%] Building CXX object src/CMakeFiles/trie_py.dir/trie.cpp.o [ 50%] Linking CXX static library ../bin/libtrie_py.a [ 50%] Built target trie_py Scanning dependencies of target cmp_trie [ 75%] Building C object src/CMakeFiles/cmp_trie.dir/trie_api.c.o [100%] Linking CXX shared library ../cmp_trie.dylib [100%] Built target cmp_trie

But when i ran demo of the project am getting

ImportError: No module named cmp_trie

Could you please let me know if am missing something?

MichalBusta commented 6 years ago

Hi,

when you are compiling extensions for MAC you have to be careful: usually there are 2 python installation system and Cellar/(or whatever its called) - so you have to check if you are not compiling for system python.

I have no experience with this kind of OS, but you can hack it with something like:

if(MAC)      include_directories("/usr/include/Cellar/python/2.7.11")

link_directories(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib)

else(MAC)     ... endif(MAC)

Michal

On 26.06.2018 18:49, vinodhkumar wrote:

Hi, I have compiled and install caffe as you have mentioned. And i have also ran the make command from the project source folder(~/DeepTextSpotter/)

[Tue Jun 26]:build (master)$ make
Scanning dependencies of target trie_py
[ 25%] Building CXX object src/CMakeFiles/trie_py.dir/trie.cpp.o
[ 50%] Linking CXX static library ../bin/libtrie_py.a
[ 50%] Built target trie_py
Scanning dependencies of target cmp_trie
[ 75%] Building C object src/CMakeFiles/cmp_trie.dir/trie_api.c.o
[100%] Linking CXX shared library ../cmp_trie.dylib
[100%] Built target cmp_trie

But when i ran demo of the project am getting

ImportError: No module named cmp_trie

Could you please let me know if am missing something?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichalBusta/DeepTextSpotter/issues/44#issuecomment-400385904, or mute the thread https://github.com/notifications/unsubscribe-auth/AD6jsBOMF7F1rmPiJmvNFyBMCtXVTndAks5uAmYvgaJpZM4UnYNb.

vinodhian commented 6 years ago

@MichalBusta I don't think the problem is because of linking directories. But anyways i set the PYTHON_INCLUDE_DIRS, PYTHON_INCLUDE_LIBRARIES flag in cmake as per my virtual env settings. And the make was successful. After making the project we get cmp_trie.dylib file in the build folder.

So i think we are trying to import a dylib file. Thats the problem i suppose.

So actually we should set the BUILD_SHARED_LIBS cmake flag to ON.

MichalBusta commented 6 years ago

On 28.06.2018 22:12, vinodhkumar wrote:

@MichalBusta https://github.com/MichalBusta I don't think the problem is because of linking directories. But anyways i set the PYTHON_INCLUDE_DIRS, PYTHON_INCLUDE_LIBRARIES flag in cmake as per my virtual env settings. And the make was successful. After making the project we get cmp_trie.dylib file in the build folder.

So i think we are trying to import a dylib file. Thats the problem i suppose.

maybe just problem with extension? cmp_trie.so@ -> cmp_trie.dylib

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MichalBusta/DeepTextSpotter/issues/44#issuecomment-401158466, or mute the thread https://github.com/notifications/unsubscribe-auth/AD6jsPMhfaYPietpIxf2pvL5xfegcuDIks5uBTiRgaJpZM4UnYNb.

Ma-Dawei commented 6 years ago

@MichalBusta I don't think the problem is because of linking directories. But anyways i set the PYTHON_INCLUDE_DIRS, PYTHON_INCLUDE_LIBRARIES flag in cmake as per my virtual env settings. And the make was successful. After making the project we get cmp_trie.dylib file in the build folder.

So i think we are trying to import a dylib file. Thats the problem i suppose.

So actually we should set the BUILD_SHARED_LIBS cmake flag to ON.

I have the same problem. So I want to know if you have solved this problem?

yihuang2016 commented 5 years ago

I also have the same problem. Do you know how to solve it ?

adifdwimaulana commented 4 years ago

@MichalBusta I don't think the problem is because of linking directories. But anyways i set the PYTHON_INCLUDE_DIRS, PYTHON_INCLUDE_LIBRARIES flag in cmake as per my virtual env settings. And the make was successful. After making the project we get cmp_trie.dylib file in the build folder.

So i think we are trying to import a dylib file. Thats the problem i suppose.

So actually we should set the BUILD_SHARED_LIBS cmake flag to ON.

Do you solve the problem after set BUILD_SHARED_LIBS flag to ON ?