Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

I am having errors and do not know what to do... #155

Description

@maxmarketit

I am following this blog,
https://medium.com/neuronio/introduction-to-adanet-c01fad8b084

I get an error from EPOCHS = 10; BATCH_SIZE = 32; train_input_fn = tf.compat.v1.estimator.inputs.pandas_input_fn ( x={"x": x_train}, y=labels_train, batch_size=BATCH_SIZE, num_epochs=EPOCHS, shuffle=False),

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-27-7ffde7f9d22e> in <module>()
      6     batch_size=BATCH_SIZE,
      7     num_epochs=EPOCHS,
----> 8     shuffle=False)

~/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/inputs/pandas_io.py in pandas_input_fn(x, y, batch_size, num_epochs, shuffle, queue_capacity, num_threads, target_column)
    108           'Cannot use name %s for target column: DataFrame already has a '
    109           'column with that name: %s' % (target_column, x.columns))
--> 110     if not np.array_equal(x.index, y.index):
    111       raise ValueError('Index for x and y are mismatched.\nIndex for x: %s\n'
    112                        'Index for y: %s\n' % (x.index, y.index))

AttributeError: 'dict' object has no attribute 'index'

I have changed
tf.estimator.inputs.numpy_input_fn to tf.compat.v1.estimator.inputs.pandas_input_fn.

my pip freeze goes like this,

plotly==4.3.0
pluggy==0.6.0
ply==3.11
prompt-toolkit==1.0.15
protobuf==3.8.0
protobuf3-to-dict==0.1.5
psutil==5.4.5
psycopg2==2.7.5
ptyprocess==0.5.2
py==1.5.3
py4j==0.10.7
pyasn1==0.4.8
pyasn1-modules==0.2.7
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pycurl==7.43.0.5
pydataset==0.2.0
pyflakes==1.6.0
pygal==2.4.0
Pygments==2.2.0
pykerberos==1.2.1
pylint==1.8.4
pyodbc==4.0.23
pyOpenSSL==18.0.0
pyparsing==2.2.0
PyQt5==5.12.3
PyQt5-sip==4.19.18
PyQtWebEngine==5.12.1
PySocks==1.6.8
pyspark==2.3.2
pytest==3.5.1
pytest-arraydiff==0.2
pytest-astropy==0.3.0
pytest-doctestplus==0.1.3
pytest-openfiles==0.3.0
pytest-remotedata==0.2.1
python-dateutil==2.7.3
python-slugify==4.0.0
pytz==2018.4
PyWavelets==0.5.2
PyYAML==3.12
pyzmq==17.0.0
QtAwesome==0.4.4
qtconsole==4.3.1
QtPy==1.4.1
rednose==1.3.0
requests==2.23.0
requests-kerberos==0.12.0
requests-oauthlib==1.3.0
retrying==1.3.3
rope==0.10.7
rsa==4.0
ruamel-yaml==0.15.35
s3fs==0.1.5
s3transfer==0.2.1
scikit-image==0.13.1
scikit-learn==0.21.3
scipy==1.4.1
seaborn==0.8.1
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.14.0
snowballstemmer==1.2.1
sortedcollections==0.6.1
sortedcontainers==1.5.10
sparkmagic==0.12.5
Sphinx==1.7.4
sphinxcontrib-websupport==1.0.1
spyder==3.2.8
SQLAlchemy==1.2.7
statsmodels==0.9.0
sympy==1.1.1
tables==3.5.2
TBB==0.1
tblib==1.3.2
tensorboard==2.1.1
tensorflow==2.1.0
tensorflow-estimator==2.1.0
tensorflow-gpu==2.1.0
tensorflow-serving-api==2.1.0
termcolor==1.1.0
terminado==0.8.1
termstyle==0.1.11
testpath==0.3.1
text-unidecode==1.3
toolz==0.9.0
tornado==5.0.2
tqdm==4.46.0
traitlets==4.3.2
typing==3.6.4
unicodecsv==0.14.1
urllib3==1.22
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.2.1
wrapt==1.11.2
xlrd==1.1.0
XlsxWriter==1.0.4
xlwt==1.3.0
zict==0.1.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions