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

model.fit(X_tr, y_tr, show_progress=True) #55

Open
zenglongjin opened this issue Mar 29, 2022 · 0 comments
Open

model.fit(X_tr, y_tr, show_progress=True) #55

zenglongjin opened this issue Mar 29, 2022 · 0 comments

Comments

@zenglongjin
Copy link

I used sparse style and the following error occurs:
`AttributeError Traceback (most recent call last)
in
----> 1 model.fit(X_tr, y_tr, show_progress=True)

~\anaconda3\lib\site-packages\tffm\models.py in fit(self, X, y, sample_weight, n_epochs, show_progress)
124 def fit(self, X, y, sample_weight=None, n_epochs=None, show_progress=False):
125 sample_weight = np.ones_like(y) if sample_weight is None else sample_weight
--> 126 self.fit(X=X, y_=y, w_=sample_weight, n_epochs=n_epochs, show_progress=show_progress)
127
128 def predict(self, X, pred_batch_size=None):

~\anaconda3\lib\site-packages\tffm\base.py in fit(self, X, y_, w_, n_epochs, show_progress)
224 # iterate over batches
225 for bX, bY, bW in batcher(X_[perm], y_=y_[perm], w_=w_[perm], batch_size=self.batch_size):
--> 226 fd = batch_to_feeddict(bX, bY, bW, core=self.core)
227 ops_to_run = [self.core.trainer, self.core.target, self.core.summary_op]
228 result = self.session.run(ops_to_run, feed_dict=fd)

~\anaconda3\lib\site-packages\tffm\base.py in batch_to_feeddict(X, y, w, core)
79 # sparse case
80 X_sparse = X.tocoo()
---> 81 fd[core.raw_indices] = np.hstack(
82 (X_sparse.row[:, np.newaxis], X_sparse.col[:, np.newaxis])
83 ).astype(np.int64)

AttributeError: 'TFFMCore' object has no attribute 'raw_indices'`

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

1 participant