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

Bug/Problem Code lines 15, 46 #23

Open
sehHeiden opened this issue May 27, 2018 · 1 comment
Open

Bug/Problem Code lines 15, 46 #23

sehHeiden opened this issue May 27, 2018 · 1 comment

Comments

@sehHeiden
Copy link

Hi,

the line:

for dirname in os.listdir(name[0])[1:]: (line 15)

Is very problematic for any other OS than MacOS.

Here the first Class is excluded from the Project!!!!

I have done this instead:


    if sys.platform == 'darwin':
        file_range = os.listdir(name[0])[1:]
    else:
        file_range = os.listdir(name[0])

    for dir_name in file_range:
        path = os.path.join(name[0], dir_name)

Because I have no Mac.

Additionally the lines 45, 46 do not work for file number larger than the size of 2Byte!

	header.append(int('0x'+hexval[2:][:2],16))
        header.append(int('0x'+hexval[2:][2:],16))

And why do you use strings instread of a bitmask? My fix was:

      for i in range(3, -1, -1):
           val = len(FileList)  # int(hexval, 16)
           mask = 0xff << (i * 8)
           erg = (val & mask) >> (i * 8)
           print(str(erg))
           header.append(erg)

But I am a novice to Tensorflow. Is it a must to use only 2 Byte for the number of files? If not, I would advice you to change that code!

@JOSHUAWENJZ
Copy link

@Meresmata GREAT!!Thank you! My problem was settled just now!I also have no Mac. When I ran these codes on Linux for reading 10 files, I found that the sixth file wasn't read anyway. After reading your comment, I just deleted the [1:] which behind the for dirname in os.listdir(name[0])[1:]: (line 15). Now all of my files can be read.

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

2 participants