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

run error on mac: TypeError: slice indices must be integers or None or have an __index__ method #18

Open
gclsoft opened this issue Jan 27, 2019 · 0 comments

Comments

@gclsoft
Copy link

gclsoft commented Jan 27, 2019

/Users/apple/.virtualenvs/TensorFlow-Examples/bin/python /Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py --mode=client --port=49624
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/apple/PycharmProjects/face'])
PyDev console: starting.
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
runfile('/Users/apple/PycharmProjects/face/face_recognition/examples/porn/pornDect.py', wdir='/Users/apple/PycharmProjects/face/face_recognition/examples/porn')
WARNING:tensorflow:From /Users/apple/PycharmProjects/face/face_recognition/examples/porn/nnpcr.py:216: softmax_cross_entropy (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.softmax_cross_entropy instead. Note that the order of the logits and labels arguments has been changed.
WARNING:tensorflow:From /Users/apple/.virtualenvs/TensorFlow-Examples/lib/python3.6/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:397: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.
See @{tf.nn.softmax_cross_entropy_with_logits_v2}.
WARNING:tensorflow:From /Users/apple/.virtualenvs/TensorFlow-Examples/lib/python3.6/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:398: compute_weighted_loss (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.compute_weighted_loss instead.
WARNING:tensorflow:From /Users/apple/.virtualenvs/TensorFlow-Examples/lib/python3.6/site-packages/tensorflow/contrib/losses/python/losses/loss_ops.py:146: add_arg_scope.<locals>.func_with_args (from tensorflow.contrib.losses.python.losses.loss_ops) is deprecated and will be removed after 2016-12-30.
Instructions for updating:
Use tf.losses.add_loss instead.
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/apple/PycharmProjects/face/face_recognition/examples/porn/pornDect.py", line 5, in <module>
    predictions = model.predict(['obama.jpg', 'timg.jpeg', '1548594791210.jpg'])
  File "/Users/apple/PycharmProjects/face/face_recognition/examples/porn/nnpcr.py", line 290, in predict
    features = loadFeatures(files)
  File "/Users/apple/PycharmProjects/face/face_recognition/examples/porn/nnpcr.py", line 90, in loadFeatures
    img = img[diff / 2: diff / 2 + w, :]
TypeError: slice indices must be integers or None or have an __index__ method

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