WeiTang114 / MVCNN-TensorFlow

An Multi-View CNN (MVCNN) implementation with TensorFlow.
MIT License
120 stars 67 forks source link

Inconsistency of code and example file #21

Open tengerye opened 6 years ago

tengerye commented 6 years ago

I am using Python3, while I think something else causes this problem.

The error appears like this:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/home/yetengqi/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/yetengqi/anaconda3/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 115, in load
    shapes = list(pool.map(self._load_shape, sub))
  File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
    yield fs.pop().result()
  File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 100, in _load_shape
    s = Shape(listfile)
  File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 15, in __init__
    self.label = int(f.readline())
ValueError: invalid literal for int() with base 10: b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n'

The following is my analysis: In the input.py

    def __init__(self, list_file):
        with open(list_file) as f:
            self.label = int(f.readline())
            self.V = int(f.readline())
            view_files = [l.strip() for l in f.readlines()]

        self.views = self._load_views(view_files, self.V)
self.done_mean = False

But in your example of train_lists.txt, the label is tagged on the second column.