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

Quickstart does not work, at all #947

Open
cmosh opened this issue Oct 31, 2017 · 2 comments
Open

Quickstart does not work, at all #947

cmosh opened this issue Oct 31, 2017 · 2 comments

Comments

@cmosh
Copy link

cmosh commented Oct 31, 2017

Just using the load.csv method returns an error. Why do I need to debug a quickstart?

import numpy as np
import tflearn

# Download the Titanic dataset
from tflearn.datasets import titanic
titanic.download_dataset('titanic_dataset.csv')

# Load CSV file, indicate that the first column represents labels
from tflearn.data_utils import load_csv
data, labels = load_csv('titanic_dataset.csv', target_column=0,
                        categorical_labels=True, n_classes=2)

Gives this error. Tensorflow by itself works perfectly by the way.

Traceback (most recent call last):
  File "titanic.py", line 10, in <module>
    data, labels = load_csv('./titanic_dataset.csv', target_column=0, categorical_labels=True, n_classes=2)
  File "/home/clive/.envs/tflearn/lib/python3.4/site-packages/tflearn/data_utils.py", line 805, in load_csv
    target = to_categorical(target, n_classes)
  File "/home/clive/.envs/tflearn/lib/python3.4/site-packages/tflearn/data_utils.py", line 46, in to_categorical
    return (y[:, None] == np.unique(y)).astype(np.float32)
TypeError: list indices must be integers, not tuple
@Hugo-Polloli
Copy link

Hugo-Polloli commented Nov 16, 2017

I've got the same issue, I mean, I tried looking into it with no success, the documentation is clear and the given code should totally work.

Have you found a way around it since then ?

edit: forgot to look into the pulls, found one about that : #950

edit2: Just after waking up tried this fix : https://github.com/tflearn/tflearn/blob/644ecd46b2a9fa7731f7da9218f77a641efcbd21/tflearn/data_utils.py
Works like a charm

@cmosh
Copy link
Author

cmosh commented Nov 21, 2017

I lost interest the moment the quickstart failed, it's just better to use tensorflow directly

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