TensorFlow various Error summary

Source: Internet
Author: User
1. The ' list ' object has no attribute ' lower ' has the following error
Traceback (most recent):
  File "h:/fasionai/mynet/train.py", line <module>
    train_logits = m Odel.inference (Train_batch, Batch_size, n_classes)
  File "H:\FasionAI\MyNet\CnnNet.py", line A, in inference
    Pool2 = Tf.nn.pool (Conv2, [1, 2, 2, 1], [1, 2, 2, 1], padding= ' SAME ', name= ' pooling2 ')
  File "E:\softinstall\Anaconda\l ib\site-packages\tensorflow\python\ops\nn_ops.py ", line 931, in Pool
    (Pooling_type.lower ()), [input]) as scope:
attributeerror: ' The list ' object has no attribute ' lower '

Problem reason: Tf.nn.max_pool () instead of Tf.nn.pool ()

2.tensorflow Version inconsistency

1) attributeerror:module ' TensorFlow ' has no attribute ' scalar_summary '

Tf.image_summary (' images ', images) instead: tf.summary.image (' images ', images)

2 attributeerror: ' Scalar_summary ' of ' module ' object has no attribute

Tf.scalar_summary (' images ', images) instead: tf.summary.scalar (' images ', images)

3) Attributeerror:module ' TensorFlow ' has no attribute ' merge_all_summaries '

Tf.merge_all_summaries () read: Summary_op = Tf.summary.merge_all ()

4 attributeerror: ' Summarywriter ' of ' module ' object has no attribute

Tf.train.SummaryWritter changed to Tf.summary.FileWriter

3.pycharm program does not recognize its own written program import show Red line

1 Open file--"setting-" open the Python console under the console, the option (ADD source roots to Pythonpat) Click on the Tick

2 Right click on their own workspace, find the following Mark Directory as select Source Root, you can solve the above problems

4.valueerror:both Labels and logits must be provided.

  File "H:\FasionAI\MyNet\resnetmodel\resnet_train.py", line, in train
    Loss_ = loss (Logits=logits, labels=labels)
  File "H:\FasionAI\MyNet\resnetmodel\resnet.py", line 148, in loss
    cross_entropy = Tf.nn.sparse_softmax_cross _entropy_with_logits (labels=labels,logits=logits)
  File "E:\softinstall\Anaconda\lib\site-packages\ tensorflow\python\ops\nn_ops.py ", line 1935, in Sparse_softmax_cross_entropy_with_logits
    labels, logits)
  File "E:\softinstall\Anaconda\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1715, in _ensure_xent_args
    Raise ValueError ("Both labels and logits must be provided.")
Valueerror:both labels and logits must be provided.

View the source after the discovery is:

  If labels is none:
    raise ValueError ("Both labels and logits must are provided.")

That is, there is a null input, and after checking that the call function Inference_small_config (x, c) does not return correctly, it should be

   return Inference_small_config (x, c)   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.