-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: cannot import name '_mask' #410
Comments
make sure the branch is pytorch-1.0 |
|
Having the same problem as well. I am using the pytorch-1.0 branch and has run "python setup.py build develop". |
Just find out that you have to install the CoCO API. cd data git clone https://github.com/pdollar/coco.git cd coco/PythonAPI make cd ../../.. |
thx a lot |
I am using pytorch 1.0 and python 3.6.7 Traceback (most recent call last): |
Just a side note. If |
I tried and failed to get things working... CoCO API is now at https://github.com/cocodataset/cocoapi I am seeing the following error even after @JojoFisherman 's suggestions
I am using Anaconda with Python 3.6
|
progress, I fixed the stale COCO pytools |
Please @jwyang add into the readme for easy install. |
请问您是怎么解决这个问题的 |
你好,我那时是COCO的安装包没安装好。
…------------------ 原始邮件 ------------------
发件人: "WUT-xiaoming"<notifications@github.com>;
发送时间: 2019年11月15日(星期五) 中午11:31
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com>;
抄送: "洪荣宣"<389817374@qq.com>;"Author"<author@noreply.github.com>;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
我使用pytorch-1.0和python3.6.7,并在conda下进行构建。构建过程未显示错误。但是,当开始训练trainval.net时,它显示以下错误:
文件“trainval_net.py”,第27行,在
从roi_data_layer.roidb进口combined_roidb
文件“/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py”,9号线,在
从datasets.factory进口get_imdb
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py”,第15行,
来自datasets.coco import coco
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/ pycocotools.coco中的“ lib / datasets / coco.py”行23,
从中导入COCO
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py”,行60
。
从中导入遮罩文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py”,第3行
。
ImportError:无法导入名称“ _mask”
似乎可可API的构建问题
请问您是怎么解决这个问题的
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
请问这个COCO要怎么安装呢?
作者在README中写用python2.7编译ROI等模块,是不是跟这个有关系
…------------------ 原始邮件 ------------------
发件人: "rongxuanHong"<notifications@github.com>;
发送时间: 2019年11月15日(星期五) 中午11:33
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com>;
抄送: "1254305549"<1254305549@qq.com>; "Comment"<comment@noreply.github.com>;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
你好,我那时是COCO的安装包没安装好。
------------------&nbsp;原始邮件&nbsp;------------------
发件人:&nbsp;"WUT-xiaoming"<notifications@github.com&gt;;
发送时间:&nbsp;2019年11月15日(星期五) 中午11:31
收件人:&nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&gt;;
抄送:&nbsp;"洪荣宣"<389817374@qq.com&gt;;"Author"<author@noreply.github.com&gt;;
主题:&nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
我使用pytorch-1.0和python3.6.7,并在conda下进行构建。构建过程未显示错误。但是,当开始训练trainval.net时,它显示以下错误:
文件“trainval_net.py”,第27行,在
从roi_data_layer.roidb进口combined_roidb
文件“/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py”,9号线,在
从datasets.factory进口get_imdb
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py”,第15行,
来自datasets.coco import coco
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/ pycocotools.coco中的“ lib / datasets / coco.py”行23,
从中导入COCO
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py”,行60
。
从中导入遮罩文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py”,第3行
。
ImportError:无法导入名称“ _mask”
似乎可可API的构建问题
请问您是怎么解决这个问题的
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
… ------------------ 原始邮件 ------------------
发件人: "WUT-xiaoming"<notifications@github.com>;
发送时间: 2019年11月15日(星期五) 中午11:36
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com>;
抄送: "洪荣宣"<389817374@qq.com>;"Author"<author@noreply.github.com>;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
请问这个COCO要怎么安装呢?
作者在README中写用python2.7编译ROI等模块,是不是跟这个有关系
------------------&nbsp;原始邮件&nbsp;------------------
发件人: "rongxuanHong"<notifications@github.com&gt;;
发送时间: 2019年11月15日(星期五) 中午11:33
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&gt;;
抄送: "1254305549"<1254305549@qq.com&gt;; "Comment"<comment@noreply.github.com&gt;;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name &#39;_mask&#39; (#410)
你好,我那时是COCO的安装包没安装好。
------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人:&amp;nbsp;"WUT-xiaoming"<notifications@github.com&amp;gt;;
发送时间:&amp;nbsp;2019年11月15日(星期五) 中午11:31
收件人:&amp;nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;gt;;
抄送:&amp;nbsp;"洪荣宣"<389817374@qq.com&amp;gt;;"Author"<author@noreply.github.com&amp;gt;;
主题:&amp;nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
我使用pytorch-1.0和python3.6.7,并在conda下进行构建。构建过程未显示错误。但是,当开始训练trainval.net时,它显示以下错误:
文件“trainval_net.py”,第27行,在
从roi_data_layer.roidb进口combined_roidb
文件“/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py”,9号线,在
从datasets.factory进口get_imdb
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py”,第15行,
来自datasets.coco import coco
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/ pycocotools.coco中的“ lib / datasets / coco.py”行23,
从中导入COCO
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py”,行60
。
从中导入遮罩文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py”,第3行
。
ImportError:无法导入名称“ _mask”
似乎可可API的构建问题
请问您是怎么解决这个问题的
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
非常感谢您的回答!!这个COCO的安装目录有要求吗?
…------------------ 原始邮件 ------------------
发件人: "rongxuanHong"<notifications@github.com>;
发送时间: 2019年11月15日(星期五) 下午2:46
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com>;
抄送: "1254305549"<1254305549@qq.com>; "Comment"<comment@noreply.github.com>;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
https://github.com/cocodataset/cocoapi
------------------&nbsp;原始邮件&nbsp;------------------
发件人:&nbsp;"WUT-xiaoming"<notifications@github.com&gt;;
发送时间:&nbsp;2019年11月15日(星期五) 中午11:36
收件人:&nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&gt;;
抄送:&nbsp;"洪荣宣"<389817374@qq.com&gt;;"Author"<author@noreply.github.com&gt;;
主题:&nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
请问这个COCO要怎么安装呢?
作者在README中写用python2.7编译ROI等模块,是不是跟这个有关系
------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人: "rongxuanHong"<notifications@github.com&amp;gt;;
发送时间: 2019年11月15日(星期五) 中午11:33
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;gt;;
抄送: "1254305549"<1254305549@qq.com&amp;gt;; "Comment"<comment@noreply.github.com&amp;gt;;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name &amp;#39;_mask&amp;#39; (#410)
你好,我那时是COCO的安装包没安装好。
------------------&amp;amp;nbsp;原始邮件&amp;amp;nbsp;------------------
发件人:&amp;amp;nbsp;"WUT-xiaoming"<notifications@github.com&amp;amp;gt;;
发送时间:&amp;amp;nbsp;2019年11月15日(星期五) 中午11:31
收件人:&amp;amp;nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;amp;gt;;
抄送:&amp;amp;nbsp;"洪荣宣"<389817374@qq.com&amp;amp;gt;;"Author"<author@noreply.github.com&amp;amp;gt;;
主题:&amp;amp;nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
我使用pytorch-1.0和python3.6.7,并在conda下进行构建。构建过程未显示错误。但是,当开始训练trainval.net时,它显示以下错误:
文件“trainval_net.py”,第27行,在
从roi_data_layer.roidb进口combined_roidb
文件“/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py”,9号线,在
从datasets.factory进口get_imdb
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py”,第15行,
来自datasets.coco import coco
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/ pycocotools.coco中的“ lib / datasets / coco.py”行23,
从中导入COCO
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py”,行60
。
从中导入遮罩文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py”,第3行
。
ImportError:无法导入名称“ _mask”
似乎可可API的构建问题
请问您是怎么解决这个问题的
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
请google搜索,都有详细的解答。
…------------------ 原始邮件 ------------------
发件人: "WUT-xiaoming"<notifications@github.com>;
发送时间: 2019年11月15日(星期五) 下午2:56
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com>;
抄送: "洪荣宣"<389817374@qq.com>;"Author"<author@noreply.github.com>;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
非常感谢您的回答!!这个COCO的安装目录有要求吗?
------------------&nbsp;原始邮件&nbsp;------------------
发件人: "rongxuanHong"<notifications@github.com&gt;;
发送时间: 2019年11月15日(星期五) 下午2:46
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&gt;;
抄送: "1254305549"<1254305549@qq.com&gt;; "Comment"<comment@noreply.github.com&gt;;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name &#39;_mask&#39; (#410)
https://github.com/cocodataset/cocoapi
------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人:&amp;nbsp;"WUT-xiaoming"<notifications@github.com&amp;gt;;
发送时间:&amp;nbsp;2019年11月15日(星期五) 中午11:36
收件人:&amp;nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;gt;;
抄送:&amp;nbsp;"洪荣宣"<389817374@qq.com&amp;gt;;"Author"<author@noreply.github.com&amp;gt;;
主题:&amp;nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
请问这个COCO要怎么安装呢?
作者在README中写用python2.7编译ROI等模块,是不是跟这个有关系
------------------&amp;amp;nbsp;原始邮件&amp;amp;nbsp;------------------
发件人: "rongxuanHong"<notifications@github.com&amp;amp;gt;;
发送时间: 2019年11月15日(星期五) 中午11:33
收件人: "jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;amp;gt;;
抄送: "1254305549"<1254305549@qq.com&amp;amp;gt;; "Comment"<comment@noreply.github.com&amp;amp;gt;;
主题: Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name &amp;amp;#39;_mask&amp;amp;#39; (#410)
你好,我那时是COCO的安装包没安装好。
------------------&amp;amp;amp;nbsp;原始邮件&amp;amp;amp;nbsp;------------------
发件人:&amp;amp;amp;nbsp;"WUT-xiaoming"<notifications@github.com&amp;amp;amp;gt;;
发送时间:&amp;amp;amp;nbsp;2019年11月15日(星期五) 中午11:31
收件人:&amp;amp;amp;nbsp;"jwyang/faster-rcnn.pytorch"<faster-rcnn.pytorch@noreply.github.com&amp;amp;amp;gt;;
抄送:&amp;amp;amp;nbsp;"洪荣宣"<389817374@qq.com&amp;amp;amp;gt;;"Author"<author@noreply.github.com&amp;amp;amp;gt;;
主题:&amp;amp;amp;nbsp;Re: [jwyang/faster-rcnn.pytorch] ImportError: cannot import name '_mask' (#410)
我使用pytorch-1.0和python3.6.7,并在conda下进行构建。构建过程未显示错误。但是,当开始训练trainval.net时,它显示以下错误:
文件“trainval_net.py”,第27行,在
从roi_data_layer.roidb进口combined_roidb
文件“/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py”,9号线,在
从datasets.factory进口get_imdb
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py”,第15行,
来自datasets.coco import coco
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/ pycocotools.coco中的“ lib / datasets / coco.py”行23,
从中导入COCO
文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py”,行60
。
从中导入遮罩文件“ /home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py”,第3行
。
ImportError:无法导入名称“ _mask”
似乎可可API的构建问题
请问您是怎么解决这个问题的
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
|
I am using Windows 10, how do i solve the problem ( from . import _mask Please help. |
1 similar comment
I am using Windows 10, how do i solve the problem ( from . import _mask Please help. |
it works. thank you!!! |
I am sorry,i cannot understand "make" and"cd../../",Can you explain it in more detail? |
I tried pip install pycocotools. And it worked |
Same issue here and I tried "pip install pycocotools" or "conda install". It worked |
thank you , it worked well! |
When I tried to
Dose anyone know what this means ? |
After generating pycocotools directory('xxx/xxx/data/coco/PythonAPI/pycocotools'), replace the original pycocotools with this new one. The new pycocotools should include file.so like '_mask.cpython-36m-x86_64-linux-gnu.so'. |
I use pytorch-1.0 and python3.6.7,and build under conda.the process of building did't show error.but,when start to train trainval.net,it shows the following error:
File "trainval_net.py", line 27, in
from roi_data_layer.roidb import combined_roidb
File "/home/ccyoung/workspace/faster-rcnn.pytorch/lib/roi_data_layer/roidb.py", line 9, in
from datasets.factory import get_imdb
File "/home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/factory.py", line 15, in
from datasets.coco import coco
File "/home/ccyoung/workspace/faster-rcnn.pytorch/lib/datasets/coco.py", line 23, in
from pycocotools.coco import COCO
File "/home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/coco.py", line 60, in
from . import mask
File "/home/ccyoung/workspace/faster-rcnn.pytorch/lib/pycocotools/mask.py", line 3, in
from . import _mask
ImportError: cannot import name '_mask'
it seems the building problem of coco API
The text was updated successfully, but these errors were encountered: