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

fastai.text do not have the ModelData module #1

Open
fooSynaptic opened this issue Oct 12, 2018 · 5 comments
Open

fastai.text do not have the ModelData module #1

fooSynaptic opened this issue Oct 12, 2018 · 5 comments

Comments

@fooSynaptic
Copy link

hello @alesee , i follow the document of your rep and run the jupyter notebook of abstractive-text-summ.ipynb to create modelData which stick the datasets to a single object.
but the fastai.text do not have the ModelData module.

NameError Traceback (most recent call last)
in
----> 1 model_data = ModelData(SAMPLE_DATA_PATH, trn_dl=train_iter_tuple, val_dl=val_iter_tuple)

NameError: name 'ModelData' is not defined

can you give me some advices to handle this problem?
or i need the check the subsequent program and write a function by myself?
thank you !

@fabrahman
Copy link

I have the same issue as well. Any help would be appreciated

@omarsar
Copy link

omarsar commented Nov 21, 2018

You may need to manually define the version of the fastai library. I used an older version: 0.7. Good luck! Reach out to me on Twitter (@omarsar0) if you continue with any issues.

@makamkkumar
Copy link

Me too having the same issue how to we resolve this in the new version of fastai v1.0.X

@fooSynaptic
Copy link
Author

Good luck to you

@p-s-vishnu
Copy link

p-s-vishnu commented May 5, 2019

this might help Code link

class ModelData():
    """Encapsulates DataLoaders and Datasets for training, validation, test. Base class for fastai *Data classes."""
    def __init__(self, path, trn_dl, val_dl, test_dl=None):
        self.path,self.trn_dl,self.val_dl,self.test_dl = path,trn_dl,val_dl,test_dl

    @classmethod
    def from_dls(cls, path,trn_dl,val_dl,test_dl=None):
        #trn_dl,val_dl = DataLoader(trn_dl),DataLoader(val_dl)
        #if test_dl: test_dl = DataLoader(test_dl)
        return cls(path, trn_dl, val_dl, test_dl)

    @property
    def is_reg(self): return self.trn_ds.is_reg
    @property
    def is_multi(self): return self.trn_ds.is_multi
    @property
    def trn_ds(self): return self.trn_dl.dataset
    @property
    def val_ds(self): return self.val_dl.dataset
    @property
    def test_ds(self): return self.test_dl.dataset
    @property
    def trn_y(self): return self.trn_ds.y
    @property
    def val_y(self): return self.val_ds.y

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

5 participants