Skip to content
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

How fix any erros whuch i get creating im2rec #3

Open
jasperDD opened this issue Feb 21, 2019 · 0 comments
Open

How fix any erros whuch i get creating im2rec #3

jasperDD opened this issue Feb 21, 2019 · 0 comments

Comments

@jasperDD
Copy link

from skimage import io

test='C:\Users\Admin\Desktop\test.lst' # folder where must be my test.lst

test='C:/Users/Admin/Desktop/test.lst'
DataSet='C:/Users/Admin/Downloads/mypic/'

data_iter = mx.image.ImageIter(
batch_size=4,
data_shape=(3,816, 1232),
label_width=4,
path_imglist='C:/Users/Admin/Desktop/test.lst',
path_root='DataSet')

for data in data_iter: d = data.data[0]
break

Error

for data in data_iter: d = data.data[0]
... break
File "", line 2
break
^
SyntaxError: invalid syntax

=================================

then

import numpy as nd
img =nd.transpose(d,(0,2,3,1))

===== Error
Traceback (most recent call last):
File "", line 1, in
NameError: name 'd' is not defined

d
Traceback (most recent call last):
File "", line 1, in
NameError: name 'd' is not defined

train_iter = mx.image.ImageIter(
... batch_size=32,
... data_shape=(3, 816, 1232),
... path_imgrec='C:/Users/Admin/Downloads/mypic/data.rec',
... path_imgidx='C:/Users/Admin/Downloads/mypic/data.idx', #help shuffle perform
ance
... shuffle=True,
... aug_list=[mx.image.HorizontalFlipAug(0.5)]
... )

============i get next errors
Traceback (most recent call last):
File "", line 7, in
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\image\image.py", line 1061, in init
self.imgrec = recordio.MXIndexedRecordIO(path_imgidx, path_imgrec, 'r') # p
ylint: disable=redefined-variable-type
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\recordio.py", line 199, in init
super(MXIndexedRecordIO, self).init(uri, flag)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\recordio.py", line 69, in init
self.open()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\recordio.py", line 202, in open
super(MXIndexedRecordIO, self).open()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\recordio.py", line 77, in open
check_call(_LIB.MXRecordIOReaderCreate(self.uri, ctypes.byref(self.handle)))

File "C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\mxnet\base.py", line 149, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [17:17:32] C:\projects\mxnet-distro-win\mxnet-build\3rdpa
rty\dmlc-core\src\io\local_filesys.cc:166: Check failed: allow_null LocalFileSy
stem::Open "C:/Users/Admin/Downloads/mypic/data.rec": No such file or directory

... train_iter.reset()
Traceback (most recent call last):
File "", line 2, in
TypeError: reset() missing 1 required positional argument: 'self'

How to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant