GithubHelp home page GithubHelp logo

Comments (8)

starry-sky6688 avatar starry-sky6688 commented on September 16, 2024

我没有遇到过这个问题,要你不debug一下,给我发一下在报错的时候具体的数据是什么,可能是batch里的u的形式不对

from marl-algorithms.

starry-sky6688 avatar starry-sky6688 commented on September 16, 2024

我在Linux和Windows上都运行过,Linux会出现这个问题,和 #44 一样,但是Windows没遇到过这个问题

from marl-algorithms.

Ricardo-Charles avatar Ricardo-Charles commented on September 16, 2024

我在Linux和Windows上都运行过,Linux会出现这个问题,和 #44 一样,但是Windows没遇到过这个问题

好的, 我来debug一下问题

from marl-algorithms.

Ricardo-Charles avatar Ricardo-Charles commented on September 16, 2024

我没有遇到过这个问题,要你不debug一下,给我发一下在报错的时候具体的数据是什么,可能是batch里的u的形式不对

我在reinforce.py 的 learn()函数里面的报错的那一行 batch[key] = torch.tensor(batch[key], dtype=torch.long)打上了断点
image
debug模式下 batch的内容, 如下面图片所示
image

展开 batch 里面的 u , type显示为 numpy.object_ , 如下图片所示
image

from marl-algorithms.

starry-sky6688 avatar starry-sky6688 commented on September 16, 2024

你这个问题应该是训练一段时间出现把?应该是 roolout.py里,66行,actions.append(action),等到epsilon很小时,每次选择的动作是神经网络得到的,导致action是一个tensor了,不是一个int型,然后在train的时候类型转换出错。我一会把这个bug改一下,你也可以自己改你的代码,在actions.append(action)之前把action改成int型就好了

from marl-algorithms.

starry-sky6688 avatar starry-sky6688 commented on September 16, 2024

我已经更新了代码,另外由于rollout.py有两个generate_episode()函数,所以两个函数都需要改一下,你试一下修改后会不会出现这个问题

from marl-algorithms.

Ricardo-Charles avatar Ricardo-Charles commented on September 16, 2024

我已经更新了代码,另外由于rollout.py有两个generate_episode()函数,所以两个函数都需要改一下,你试一下修改后会不会出现这个问题

修改后我的成功了, 谢谢作者您的耐心解答, 抱歉占用了您的很多时间, 以后如果有我能帮到作者你的, 我一定会报答作者您.

from marl-algorithms.

Ricardo-Charles avatar Ricardo-Charles commented on September 16, 2024

你这个问题应该是训练一段时间出现把?应该是 roolout.py里,66行,actions.append(action),等到epsilon很小时,每次选择的动作是神经网络得到的,导致action是一个tensor了,不是一个int型,然后在train的时候类型转换出错。我一会把这个bug改一下,你也可以自己改你的代码,在actions.append(action)之前把action改成int型就好了

对, 我这个问题是 训练一段时间后出现的

from marl-algorithms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.