Skip to content

How fix any erros whuch i get creating im2rec #3

@jasperDD

Description

@jasperDD

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions