Open 18804601171 opened 4 years ago
You may want to try add _sys.path.insert(1, 'PATH_TO_YOUR/DOTAdevkit/') before import polyiou
I faced the same issue and below are the steps on how I fixed it.
After running python setup.py build_ext --inplace
for setting up DOTA_devkit, I was getting some warnings.
Basically, the error ModuleNotFoundError: No module named 'polyiou'
pops up when polyiou is not properly installed.
You can see that there must be a hidden _polyiou.XXX.so file kept in the DOTA_devkit folder. The issue is that this file should be imported in polyiou.py
file properly but since package imp is deprecated the import statement doesn't work properly.
You can find the below line in polyiou.py
file generated automatically through swig:
_mod = imp.load_module('_polyiou', fp, pathname, description)
And you can replace the above statement with below statement:
_mod = importlib.import_module('_polyiou.cpython-36m-x86_64-linux-gnu.so', [dirname(__file__)])
Don't forget to import importlib
package and change the above _polyiou.cpython-36m-x86_64-linux-gnu.so with the appropriate file name installed in your directory.
Reference:
I faced the same issue and below are the steps on how I fixed it.
After running
python setup.py build_ext --inplace
for setting up DOTA_devkit, I was getting some warnings. Basically, the errorModuleNotFoundError: No module named 'polyiou'
pops up when polyiou is not properly installed.You can see that there must be a hidden _polyiou.XXX.so file kept in the DOTA_devkit folder. The issue is that this file should be imported in
polyiou.py
file properly but since package imp is deprecated the import statement doesn't work properly. You can find the below line inpolyiou.py
file generated automatically through swig:_mod = imp.load_module('_polyiou', fp, pathname, description)
And you can replace the above statement with below statement:
_mod = importlib.import_module('_polyiou.cpython-36m-x86_64-linux-gnu.so', [dirname(__file__)])
Don't forget toimport importlib
package and change the above _polyiou.cpython-36m-x86_64-linux-gnu.so with the appropriate file name installed in your directory.Reference:
Thank you for your suggestion.
Indeed, I followed your point and have done the same, but still have the same problem. In the updated DOTA_devkit I did not find _mod = imp.load_module('_polyiou', fp, pathname, description)
. However, as you suggested I followed your instructions. But, still have the same problem.
I appreciated any suggestion to solve this problem.
Hi @MFalam,
Thanks for trying out my suggestion.
Out of the box, I can see that you don't have .so
at the end of the file name in the added line. Could you please try again after adding that.
Also the generated file name _polyiou.cpython-36m-x86_64-linux-gnu.so
, is it exactly same for your file? I cannot see the full filename in the screenshot.
Also could you please share the contents of polyiou.py
file if the above fix doesn't solve your problem. Thanks!
Hi @MFalam, Thanks for trying out my suggestion. Out of the box, I can see that you don't have
.so
at the end of the file name in the added line. Could you please try again after adding that.Also the generated file name
_polyiou.cpython-36m-x86_64-linux-gnu.so
, is it exactly same for your file? I cannot see the full filename in the screenshot.Also could you please share the contents of
polyiou.py
file if the above fix doesn't solve your problem. Thanks!
Hello @dineshdaultani
Thanks for the suggestion.
I solved this issue by adopting 'dotadevkit'. I used the following steps.
First, download 'dotadevkit' from ### https://github.com/ashnair1/dotadevkit and follow the steps to install it.
Second, replace import polyiou
with from dotadevkit.polyiou import polyiou
in the 'ResultMerge_multi_process.py' and 'ResultMerge.py' files of 'BBAVectors-Oriented-Object-Detection' that are loaded from the 'Dota_devkit'.
Hi @MFalam, Thanks for trying out my suggestion. Out of the box, I can see that you don't have
.so
at the end of the file name in the added line. Could you please try again after adding that. Also the generated file name_polyiou.cpython-36m-x86_64-linux-gnu.so
, is it exactly same for your file? I cannot see the full filename in the screenshot. Also could you please share the contents ofpolyiou.py
file if the above fix doesn't solve your problem. Thanks!Hello @dineshdaultani Thanks for the suggestion. I solved this issue by adopting 'dotadevkit'. I used the following steps. First, download 'dotadevkit' from ### https://github.com/ashnair1/dotadevkit and follow the steps to install it. Second, replace
import polyiou
withfrom dotadevkit.polyiou import polyiou
in the 'ResultMerge_multi_process.py' and 'ResultMerge.py' files of 'BBAVectors-Oriented-Object-Detection' that are loaded from the 'Dota_devkit'.
In dotadevkit, it will install opencv-4.5.3, but the minAreaRect have different definition in opencv-4.0.36( [-90,0) ) and opencv-4.5.3( (0,90] ), if you use dotadevkit, you should note this.
from datasets.DOTA_devkit import polyiou
You can refer your question to the
DOTA_devkit
repo. Duplicate of https://github.com/CAPTAIN-WHU/DOTA_devkit/issues/37