![](/img/trans.png)
[英]Error when saving model with tensorflow-agents
我正在嘗試使用 tensorflow-agents 保存模型。 首先我定義如下: 然后像這樣保存模型: 這在 google colab 中工作正常,但我在本地 PC 中收到以下錯誤。 這些是我正在使用的庫版本: 張量流 2.9.1 tf-代理 0.11.0 ...
[英]Error when saving model with tensorflow-agents
我正在嘗試使用 tensorflow-agents 保存模型。 首先我定義如下: 然后像這樣保存模型: 這在 google colab 中工作正常,但我在本地 PC 中收到以下錯誤。 這些是我正在使用的庫版本: 張量流 2.9.1 tf-代理 0.11.0 ...
[英]Benefit of storing state as a list/integer in tensorflow agents
In the environment tutorial of tensorflow agents ( https://www.tensorflow.org/agents/tutorials/2_environments_tutorial ), the state is stored as an i ...
[英]PPOAgent + Cartpole = ValueError: actor_network output spec does not match action spec:
我正在嘗試在 CartPole-v1 環境中使用 tf_agents 的 PPOAgent 進行試驗,但在聲明代理本身時收到以下錯誤: 我相信問題是我的網絡的輸出是tf.float32而不是tf.int64 ,但我可能是錯的。 我不知道如何使網絡輸出一個整數,據我所知,這是不可能或不希望的。 ...
[英]tf_agents doesn't properly learn a simple environment
我成功地遵循了這個官方的 tensorflow 教程來訓練代理來解決“CartPole-v0”健身房環境。 我只是與教程不同,因為我沒有使用reverb ,因為它在 Windows 上不受支持。 我嘗試修改示例以訓練代理解決我自己的(極其簡單的)環境,但在 10,000 次迭代后未能收斂到解決方案, ...
[英]How to get probability vector for all actions in tf-agents?
我正在使用LinearUCBAgent和LinearThompsonSamplingAgent解決多臂強盜問題,但它們都返回單個動作進行觀察。 我需要的是可用於排名的所有動作的概率。 ...
[英]TF-Agents error: TypeError: The two structures do not match: Trajectory vs. Trajectory
我正在與TF-Agents DQN 教程一起構建 PPO 代理。 這個想法是檢查一個簡單的 tf-agent 工作所需的基本結構,並使其適應 PPO 代理。 我也在使用自定義環境 ViZDoom。 它安裝並正常工作。 測試“collect_data” function 時出現錯誤。這是我正在運行的 ...
[英]How to give a tuple of actions to a TF-Agents environment within the step method?
我想要 model 我的環境,這樣每個動作都由 3 個可能的子動作組成。 我已經將我的tf_agents.environments.py_environment.PyEnvironment的_action_spec定義為: 我在step方法中失敗了,我正在嘗試: 但它給出了ValueError: ...
[英]Shape of _observation_spec and shape of _action_spec in the Tf-agents environments example
在TF-Agents Environments的tensorflow 文檔中,有一個簡單(受二十一點啟發)紙牌游戲的環境示例。 init如下所示: 動作規范只允許 0(不要求卡片)或 1(要求卡片),因此形狀是shape=() (只需要一個整數)是明智的。 但是,我不太明白觀察規范形狀是s ...
[英]What changes occur when using tf_agents.environments.TFPyEnvironment to convert a Python RL environment into a TF environment?
我注意到在使用 tf_agents.environments.TFPyEnvironment 將 Python 環境轉換為 TF 環境時發生了一些奇怪的事情,我想問您發生了哪些一般性變化。 為了澄清這個問題,請在我的代碼下面找到。 我希望環境模擬(以過於簡單的方式)與想要購買水果或蔬菜的客戶的互動 ...
[英]Merging and splitting time and action steps from TF-agents
我正在嘗試在一個簡單的多代理非合作並行游戲中使用 TF 代理。 為簡化起見,我有兩個用 TF 代理定義的代理。 我定義了一個自定義的健身房環境,它將代理的組合動作作為輸入並返回一個觀察結果。 代理的策略不應將全部觀察作為輸入,而應僅將其一部分作為輸入。 所以我需要做兩件事: 拆分 TF-agents ...
[英]How to fix a TypeError between policy_state and policy_state_spec in TF-Agents?
我正在開發一個使用 TF-Agents 播放(嗯,應該)Doom 的 PPO 代理。 作為代理的輸入,我試圖給它一堆 4 張圖像。 我的完整代碼在以下鏈接中: https://colab.research.google.com/drive/1chrlrLVR_rwAeIZhL01LYkpXsusy ...
[英]Need full example of using tf-agents Ddpgagent
我在TensorFlow中找不到任何使用來自tf-agents的DdpgAgent的完整示例,並且無法使其正常工作。 有人可以鏈接一段完整的代碼或一個完整的教程,為它創建和訓練一個ddpg 代理和一個data_spec 。 ...
[英]Can a tf-agents environment be defined with an unobservable exogenous state?
對於標題中的問題不是很清楚,我提前道歉。 我正在嘗試使用 tf-agents 訓練強化學習策略,其中存在一些影響 state 的不可觀察的隨機變量。 例如,考慮標准的 CartPole 問題,但我們在速度隨時間變化的地方添加風。 我不想訓練一個依賴於每一步觀察風速的代理; 相反,我希望風影響桿的 ...
[英]TF-agents - Replay buffer add trajectory to batch shape mismatch
我發布了一個由另一個用戶發布然后被刪除的問題。 我有同樣的問題,我找到了答案。 原來的問題: 我目前正在嘗試按照本教程實施分類 DQN: https://www.tensorflow.org/agents/tutorials/9_c51_tutorial 以下部分讓我有點頭疼:random_poli ...
[英]TFAgents: how to take into account invalid actions
我正在使用 TF-Agents 庫進行強化學習,並且我想考慮到,對於給定的 state,某些操作是無效的。 如何實施? 創建 DqnAgent 時是否應該定義“observation_and_action_constraint_splitter”function? 如果是的話:你知道這方面的任何教程 ...
[英]Tensorflow 2.x Agents(TF-Agents, Reinforcement Learning Module) & PySC2
有pysc2( https://github.com/deepmind/pysc2 ) & Tensorflow(1.x) 和OpenAI-Baselines( https://github.com/openai/baselines ),像下面這樣 TF 團隊最近提出了一個稱為 TF-A ...
[英]Can tf.agent policy return probability vector for all actions?
我正在嘗試使用 TF-Agent TF-Agent DQN Tutorial訓練強化學習代理。 在我的應用程序中,我有 1 個動作,其中包含 9 個可能的離散值(標記為 0 到 8)。 下面是env.action_spec()的輸出 我想得到概率向量包含所有由訓練策略計算的動作,並在其他應用環境 ...
[英]Tf Agents Parallel Py Environment With an Environment that has Input Parameters
假設您有一個具有輸入參數的環境:例如,要創建一個您將使用的實例 env_instance = MyEnv(var_1=3, var_2=5, ...) 現在假設您想使用環境“MyEnv”創建一個 parallel_py_environment ? 由於您需要輸入參數,因此不能使用 tf_py_en ...
[英]tf_Agent is not training properly?
此代碼應使用 TF-Agents 庫在 Cartpole 環境中訓練 DQN(深度 Q 網絡)代理,但該代理似乎未正確訓練。 我正在嘗試使用 Driver 模塊編寫一個最小的示例。 我還可以運行 TF-Agents 庫中的示例。 Code 正在運行,但是Agent 訓練后不能玩游戲。 此外, ...
[英]IndexError in random.shuffle when class is executed concurrently
我創建了一個自定義環境,用於使用tf-agents進行強化學習(不需要回答此問題),如果我通過將num_parallel_environments設置為1實例化一個線程,則可以正常工作,但是會在random.shuffle()引發罕見且看似隨機的錯誤,例如IndexError random.sh ...