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

Error in data_layer function "_get_next_minibatch" #19

Open
Tushn opened this issue Jul 25, 2018 · 6 comments
Open

Error in data_layer function "_get_next_minibatch" #19

Tushn opened this issue Jul 25, 2018 · 6 comments

Comments

@Tushn
Copy link

Tushn commented Jul 25, 2018

Hello,

I was trying to run this code with this dataset: http://vis-www.cs.umass.edu/lfw/
I needed to fix some problems in code, but has one I could not fix, when I run "train.py" I got this error below:

  File "/home/user/projects/triplet/data_layer.py", line 36, in _get_next_minibatch
    print('lenAttributeError: 'DataLayer' object has no attribute '_data'

(self._data._sample): '+str(len(self._data._sample)))

I can't see where this error occur, because my code execute that function "_shuffle_data" the same object and printed "self._data" without problems, when I was trying to execute "sw.train_model(max_iters)" (in "train.py") this error to occur.

@ly0303521
Copy link

Same problem with you , have you solved??

@ly0303521
Copy link

@Tushn

@ly0303521
Copy link

@Tushn comment test in solver

@Tushn
Copy link
Author

Tushn commented Oct 30, 2018

@ly0303521 I forked this project few months ago, I could used that, but I have cant remember what I did. After, I was rewrote that layers in my studies with Caffe, unfortunately some codes are not public and I need review how to do.

I recommend that you download it, in: https://github.com/Tushn/triplet

I remember which I used HDF5 compressed file, well I'll try to review my code if you need.

@ly0303521
Copy link

comment test in solver.prototxt, I find the answer in the closed issues

@Tushn
Copy link
Author

Tushn commented Nov 12, 2018

@ly0303521 did you solve your this problem, only commenting test in solver.prototxt?

Actually, that is one problem, I found my private code and could to fix in this net. But, that code is not too beautiful yet, I'm updating in my repository now.

Some problems which I got are:

  1. data_layer.py: "self._data", I could solve this calling sample directly in my setup.py
    def setup(self, bottom, top):
        """Setup the DataLayer."""
        print(' --- SETUP --- ')
        self.data = sampledata()
        if cfg.TRIPLET_LOSS:
            self.batch_size = cfg.TRIPLET_BATCH_SIZE
        else:
            self.batch_size = cfg.BATCH_SIZE
        self._name_to_top_map = {
            'data': 0,
            'labels': 1}

        self._index = 0
        self._epoch = 1
        top[0].reshape(self.batch_size, 3, 30, 30)
        top[1].reshape(self.batch_size)

Note: I needed to resize face images

  1. I changed "utils/blobs.py" for target_size = 30

  2. I changed "sampledata.py" and its paths

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