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

过一个pass就停止不动了,内存占用着,但是cpu和gpu都为0了,就一直不动了 #2619

Closed
bjkite opened this issue Jun 27, 2017 · 0 comments · Fixed by #2631
Assignees

Comments

@bjkite
Copy link

bjkite commented Jun 27, 2017

经确认,是在reader的实现中使用了 paddle.reader.xmap_readers的原因,去掉不用就不会出现
代码如下:

   def reader():
        UNK = word_id_dict['<UNK>']
        with open(file_name) as file:
            count = 0
            for line in file:
                image_path,image_tag = line.strip().split("\t")
                words = image_tag.decode('utf-8', 'ignore').strip().split()
                if len(words) < min_sentence_length or len(
                        words) > max_sentence_length:
                    continue
                ids = [word_id_dict.get(w, UNK) for w in words]
                ids.append(word_id_dict['<EOS>'])
                target = ids[:]
                target.append(word_id_dict['<EOS>'])
                count += 1
                yield image_path, ids[:], target[:]

    return paddle.reader.xmap_readers(image_mapper, reader,
                                     1, buffered_size)
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

Successfully merging a pull request may close this issue.

2 participants