小编jus*_*ing的帖子

类型错误:“ReadFile”操作的输入“文件名”的类型为 float32,与预期的字符串类型不匹配

我从这里的教程中运行此代码:https : //keras.io/examples/vision/image_classification_from_scratch/

使用自定义数据集,如教程中那样分为 2 个数据集。但是,我收到此错误:

TypeError: Input 'filename' of 'ReadFile' Op has type float32 that does not match expected type of string.
Run Code Online (Sandbox Code Playgroud)

我做了这个铸件。我试过这个:

is_jfif = str(tf.compat.as_bytes("JFIF")) in fobj.peek(10)
Run Code Online (Sandbox Code Playgroud)

但就我整天试图找出解决方法的错误而言,没有任何改变,但没有任何成功。有人能帮我吗?谢谢...

python keras

8
推荐指数
1
解决办法
9398
查看次数

运行时错误:[在 inline_container.cc:145 处强制失败]。PytorchStreamReader 读取 zip 存档失败:找不到中心目录

我正在遵循本教程: https: //blog.paperspace.com/train-yolov5-custom-data/为了训练自定义数据集。我完全按照本教程中所述的步骤进行操作。但是当我尝试这个命令时:python3 train.py --img 640 --cfg yolov5s.yaml --hyp hyp.scratch.yaml --batch 32 --epochs 100 --data road_sign_data.yaml --weights yolov5s.pt --workers 24 --name yolo_road_det我收到此错误:

  File "/home/UbuntuUser/.local/lib/python3.8/site-packages/torch/serialization.py", line 242, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip archive: failed finding central directory
Run Code Online (Sandbox Code Playgroud)

我在谷歌中搜索过,发现类似的线程: https: //discuss.pytorch.org/t/error-on-torch-load-pytorchstreamreader-failed/95103和这个:last.ckpt | 运行时错误:[在 inline_container.cc:145 处强制失败]。PytorchStreamReader 读取 zip 存档失败:未能找到中心目录,但我找不到解决方案!问题就在这里:

class _open_zipfile_reader(_opener):
    def __init__(self, name_or_buffer) -> None:
        super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
Run Code Online (Sandbox Code Playgroud)

我按照上面教程的步骤操作,我不知道如何解决它......你能帮我吗?

customization python-3.x yolo

8
推荐指数
0
解决办法
3262
查看次数

TypeError: file must have 'read' and 'readline' attributes

1st approach: I am trying to make the below code work since morning. I have read many answers here in stackoverflow and tutorials on google about python, I have done 0 progress. Can you help me with this error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "source_code_modified.py", line 65, in <module>
    dict1 = pickle.load(f1,encoding='bytes')
TypeError: file must have 'read' and 'readline' attributes
Run Code Online (Sandbox Code Playgroud)

The code that explodes is this part:

class load_train_data:
    os.open("/home/just_learning/Desktop/CNN/datasets/training_data/images", os.O_RDONLY)
    def __enter__(self):
        return self
    def …
Run Code Online (Sandbox Code Playgroud)

python

6
推荐指数
1
解决办法
1万
查看次数

OWL、RDF、TTL 之间的区别

我正在搜索教程和维基百科来了解 OWL、RDF、TTL 之间的区别。据我了解,所有这些都是元数据(或本体),但它们之间的本质区别到底是什么?谢谢...

https://www.w3.org/RDF/ https://en.wikipedia.org/wiki/Web_Ontology_Language

protege

5
推荐指数
1
解决办法
3584
查看次数

将wireshark与ns3一起使用

我正在搜索 google 以了解如何将wireshark 与 ns-3 一起使用,但我很困惑。据我所知,它需要特定的文件才能工作。如何使用 ns-3 制作这个特定文件?

wireshark

2
推荐指数
1
解决办法
657
查看次数

标签 统计

python ×2

customization ×1

keras ×1

protege ×1

python-3.x ×1

wireshark ×1

yolo ×1