Pixel2Mesh
Pixel2Mesh copied to clipboard
build_cnn18 - inconsistent use of tabs and spaces in indentation
Hi All,
I'm getting an error
Traceback (most recent call last):
File "demo.py", line 20, in
when I removed '] from line x=self.placeholders['img_inp'] and writed it again I have
Traceback (most recent call last):
File "demo.py", line 20, in
Do you have an idea what could be wrong?
Thank you,
tj
Hello, I have the same problem, as shown in the error message the code uses both tab characters and softtabs (4 tabs in a row) for indentation in the same file. This is not allowed by python, I wrote a script which you find below. It fixes the error by replacing the tabs. Simply run it from the repository root folder (where demo.py is located). But I highly recommend you to not use this repositories code, as it uses deprecated old Tensorflow <= 1.14 and old Python <= 2.7. There are newer implementations using pytorch: https://github.com/noahcao/Pixel2Mesh and https://github.com/Tong-ZHAO/Pixel2Mesh-Pytorch But fixing this code would be nice as above code is only available to CUDA as it seems. Greetings, MrMois
Script:
import os
NUMSPACES = 4
for (path, dirs, files) in os.walk('.'):
for file in files:
if(file[-3:] == '.py'):
print('Currently at: %s\\%s' % (path, file))
str = ''
with open(path + '\\' + file, 'r+') as fHandle:
str = fHandle.read()
if '\t' in str:
if ' ' in str:
print('Found tabs and doublespaces, yay!')
else:
print('Found tabs...')
str = str.replace('\t', ' ' * NUMSPACES)
# Goto file start
fHandle.seek(0)
fHandle.write(str)
print('Replaces tabs with %i whitespaces.' % NUMSPACES)
else:
print('Ok.')
print('---------')
Hi, Do you know how to download the dataset and unzip it?