python - 读取地图文件
问题描述
这段代码有什么问题?显示未找到模块错误。
代码:
data_dir = 'D://ob//Imag'
mapfile = os.path.join(data_dir,'map.txt')
# Read the mapfile:
with open(mapfile,'r') as fp:
mp = (
st.strip().split(' ')\
for st in fp.readlines()
)
fixpath = lambda x: os.path.abspath(os.path.join(data_dir,x))
mp = [
(fixpath(x[0]), fixpath(x[1]))\
for x in mp
]
label_map_dict = label_map_util.get_label_map_dict('D://ob//Imag//abc.pbtxt')
错误:
FileNotFoundError Traceback (most recent call last)
<ipython-input-39-96f2621dd3fd> in <module>()
3
4 # Read the mapfile:
----> 5 with open(mapfile,'r') as fp:
6
7 mp = (
FileNotFoundError: [Errno 2] No such file or directory: 'D://ob//Imag/map.txt'
解决方案
推荐阅读
- r - 如何为绘图中的不同区域设置不同的 ggplot2 背景
- syntax-error - 新手 Solidity 错误/问题 - 'ParserError: Expected identifier but got 'function'...'
- azure - 创建可以处理多个队列的 Azure.Storage.Queues 客户端
- javascript - 如何将 PHP 变量传递给 AJAX URL
- discord - 禁止命令:ReferenceError:消息未定义(Discord.Js)
- java - 线程“主”java.lang.ArrayIndexOutOfBoundsException 中的异常:索引 2 超出范围
- php - 如何将 mikrotik 命令结果发送到 php
- asp.net - 为请求记录创建唯一字符串 ASP.NET Core MVC
- firebase - 如何限制firebase函数的实例数
- rdf - RDF OWL - 一个语句可以用作另一个语句的对象吗?