Skip to content

代码运行需要什么样的 python环境 #2

@xiaohuihui1024

Description

@xiaohuihui1024

使用 Tensorflow 2.x 作为 keras 后端,报如下错误

Traceback (most recent call last):
  File ".\vuldeepecker.py", line 100, in <module>
    main()
  File ".\vuldeepecker.py", line 96, in main
    blstm.train()
  File "xxx\blstm.py", line 72, in train
    epochs=4, class_weight=self.class_weight)
  File "C:\Anaconda\Lib\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
    return method(self, *args, **kwargs)
  File "C:\Anaconda\Lib\site-packages\tensorflow\python\keras\engine\training.py", line 815, in fit
    model=self)
  File "C:\Anaconda\Lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1124, in __init__
    if class_weight:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions