There are no graphs in the scene UnityEngine.Debug:LogError (object) AstarPath:StartPath (Pathfinding.Path,bool) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1952) Pathfinding.Seeker:StartPathInternal (Pathfinding.Path,Pathfinding.OnPathDelegate) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:469) Pathfinding.Seeker:StartPath (Pathfinding.Path,Pathfinding.OnPathDelegate) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:419) Pathfinding.Seeker:StartPath (UnityEngine.Vector3,UnityEngine.Vector3,Pathfinding.OnPathDelegate) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:382) Pathfinding.Seeker:StartPath (UnityEngine.Vector3,UnityEngine.Vector3) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:369) PathGetter:BeginFindPath (UnityEngine.Vector3) (at Assets/Scripts/PathGetter.cs:54) PathGetter:OnButton2Clicked () (at Assets/Scripts/PathGetter.cs:43) UnityEngine.EventSystems.EventSystem:Update () (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:514)
时间: 2024-04-10 16:30:20 浏览: 87
It looks like there is an error in the Unity engine related to pathfinding. The error message suggests that there are no graphs in the scene, which might be causing the issue. It seems to be a problem with the A* Pathfinding Project plugin. You can try checking if the necessary graphs are properly set up in your scene, and make sure that the A* Pathfinding component is attached to the correct GameObject. Additionally, you can check the A* Pathfinding Project documentation or seek help from the plugin's support community for further assistance in resolving this error.
相关问题
D:\code\myworld\lib\site-packages\dgl\heterograph.py:92: DGLWarning: Recommend creating graphs by `dgl.graph(data)` instead of `dgl.DGLGraph(data)`. dgl_warning( Traceback (most recent call last): File "E:/403/myworld/GraphShow.py", line 35, in <module> g.add_edge(src, dst) AttributeError: 'DGLGraph' object has no attribute 'add_edge'
这个错误提示显示你使用了 `add_edge` 方法,但是 `DGLGraph` 对象并没有这个方法。可能是因为你的 DGL 版本更新了,在新版本中这个方法被移除了。建议使用 `add_edges` 方法来添加边。比如:
```
g.add_edges(src, dst)
```
另外,如果你要创建一个新的图,也可以使用 `dgl.graph` 函数来创建,它比 `DGLGraph(data)` 更为推荐。比如:
```
g = dgl.graph((src, dst))
```
D:\code\myworld\lib\site-packages\requests\__init__.py:109: RequestsDependencyWarning: urllib3 (2.0.2) or chardet (None)/charset_normalizer (3.0.1) doesn't match a supported version! warnings.warn( Traceback (most recent call last): File "E:/403/myworld/graphBatch.py", line 38, in <module> dgl.save_graphs(OUT_PATH + "merged_graph_train.bin",[merged_graph_train],'coo') File "D:\code\myworld\lib\site-packages\dgl\data\graph_serialize.py", line 142, in save_graphs save_heterographs(filename, g_list, labels, formats) File "D:\code\myworld\lib\site-packages\dgl\data\heterograph_serialize.py", line 37, in save_heterographs filename, gdata_list, tensor_dict_to_ndarray_dict(labels), formats File "D:\code\myworld\lib\site-packages\dgl\data\heterograph_serialize.py", line 17, in tensor_dict_to_ndarray_dict for key, value in tensor_dict.items(): AttributeError: 'str' object has no attribute 'items'
这个错误提示表明在执行`dgl.save_graphs`函数时,传入的`labels`参数是一个字符串,而不是一个字典类型的对象,导致在调用`tensor_dict_to_ndarray_dict`函数时发生了错误。需要将`labels`参数改为字典类型的对象,或者将其置为空字典`{}`即可。
修改后的代码示例如下:
```python
import dgl
import torch
# 创建一张图
g = dgl.graph([(0, 1), (1, 2), (2, 3)])
g.ndata['feat'] = torch.randn(4, 5)
g.edata['feat'] = torch.randn(3, 3)
# 以COO格式存储
dgl.save_graphs('graph.bin', [g], 'coo', {})
# 读取存储的图
glist, _ = dgl.load_graphs('graph.bin')
print(glist)
```
在上面的示例中,我们将`labels`参数改为空字典`{}`,以COO格式存储了一张图,并用`load_graphs`函数读取了存储的图。
阅读全文