Comments (2)
Recently, I also found out that the error seems to originate from the utils.py (https://github.com/mboudiaf/pytorch-meta-dataset/blob/master/src/datasets/utils.py) file - sometimes, my program would hang after going into an infinite loop in cycle_ and eventually crashes with the above error.
So basically this is what happens:
First, in https://github.com/mboudiaf/pytorch-meta-dataset/blob/master/src/datasets/pipeline.py the code attempts to fetch a sample from a class, using sample_dic = next(self.class_datasets[class_id])
. But then this raises a TypeError: 'TFRecordDataset' object is not an iterator
exception, so it attempts to call cycle_()
on the class in the except clause.
def get_next(self, class_id):
try:
sample_dic = next(self.class_datasets[class_id])
except (StopIteration, TypeError) as e:
self.class_datasets[class_id] = cycle_(self.class_datasets[class_id])
sample_dic = next(self.class_datasets[class_id])
return sample_dic
But, in the function cycle_ in utils.py the code tries to yield the next sample in the iterator, and if not, it will attempt to reset the iterator. So the code looked like this:
def cycle_(iterable):
# Creating custom cycle since itertools.cycle attempts to save all outputs in order to
# re-cycle through them, creating amazing memory leak
iterator = iter(iterable)
while True:
try:
yield next(iterator)
except StopIteration:
iterator = iter(iterable)
The issue I think is happening is that there is some iteration where the class iterable is empty (something like iter([])
). I'm wondering if this may be due to a deformed/corrupted tfrecord (since I did specify a fixed 5-way, 10-shot task)? I'm thinking the class is empty since it's telling me that KeyError: "Key image doesn't exist (select from [])!"
, suggesting that the class we're trying to iterate from might be entirely empty.
As such I am wondering if I need to reinstall the files for meta-dataset? Or is there an issue with the code I'm running?
from pytorch-meta-dataset.
@mboudiaf I'm also interested in this
from pytorch-meta-dataset.
Related Issues (20)
- CrossTransformers implementation HOT 1
- no bash file HOT 1
- No dataset_spec file found in directory
- ResNet structure HOT 5
- How to run the code correctly? HOT 2
- Learn2Learn support? HOT 3
- where is make_index_files.sh HOT 1
- Too many unexpected Errors.
- Training the fine-tuned base line with standard supervised learning with union/concatenation of labels
- version of tensorflow-gpu being used? HOT 2
- how long does make index take?
- What are tricks to speed up training for SL and MAML?
- How can we use all classes all the time for episodic training even if the number of examples is small?
- Main feature differences between pytorch-meta-dataset and original meta-dataset?
- how to compute data set size form tfrecrods for mds (within python)? HOT 1
- Unexpected behavior from min_examples_in_class HOT 2
- shuffle buffer issue? HOT 8
- Meta-batch size hard coded to 1 HOT 2
- Feature Request: Ideally the episodes generated would be repeatable for a specified seed. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-meta-dataset.