You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to use the QUICKPOMDPs interfaces with python. While I managed to use the DiscreteExplicitPOMDP interface, I am struggling in using the QuickPOMDP interface in python.
Indeed, here is the list of difficulties I am facing:
While I am able to define an instance of QuickPOMDP object, I can't apply any solver on it, for example SARSOP. I was able to run this solver with the DiscreteExplicitPOMDP object as in tiger.py (so it is not an installation issue). I am globally having this error (it is the same if I use another solver such as QMDPSolver):
========================================
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-5d5ce468204e> in <module>
1 solver = SARSOPSolver()
----> 2 policy = solve(solver, pomdp)
TypeError: '>' not supported between instances of 'method' and 'int'
Another problem I am facing is that the parameter "isterminal" of the QuickPOMDP is not well handled. Actually when implementing the function isterminal(s) which a return a boolean and use it as the terminal function in the QuickPOMDP iterfacte, I got an error:
==========================================
TypeError: Julia exception: TypeError: non-boolean (PyObject) used in boolean context
Stacktrace:
[1] iterate(::POMDPSimulators.POMDPSimIterator{(:s, :a, :o),QuickPOMDPs.QuickPOMDP{UUID("0fbc5ae6-f61e-43a8-ac7e-9abfa223a2ec"),String,String,String,NamedTuple{(:stateindex, :isterminal, :obsindex, :states, :observations, :discount, :actions, :initialstate_distribution, :observation, :actionindex, :transition, :reward, :initialstate),Tuple{PyObject,PyObject,PyObject,Array{String,1},Array{String,1},Float64,Array{String,1},PyObject,PyObject,PyObject,PyObject,PyObject,String}}},POMDPPolicies.RandomPolicy{Random.MersenneTwister,QuickPOMDPs.QuickPOMDP{UUID("0fbc5ae6-f61e-43a8-ac7e-9abfa223a2ec"),String,String,String,NamedTuple{(:stateindex, :isterminal, :obsindex, :states, :observations, :discount, :actions, :initialstate_distribution, :observation, :actionindex, :transition, :reward, :initialstate),Tuple{PyObject,PyObject,PyObject,Array{String,1},Array{String,1},Float64,Array{String,1},PyObject,PyObject,PyObject,PyObject,PyObject,String}}},BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random.MersenneTwister,Nothing,String}, ::Tuple{Int64,String,Nothing}) at /home/fansitca/.julia/packages/POMDPSimulators/nMXAP/src/stepthrough.jl:86 (repeats 2 times)
[2] jlwrap_iterator(::POMDPSimulators.POMDPSimIterator{(:s, :a, :o),QuickPOMDPs.QuickPOMDP{UUID("0fbc5ae6-f61e-43a8-ac7e-9abfa223a2ec"),String,String,String,NamedTuple{(:stateindex, :isterminal, :obsindex, :states, :observations, :discount, :actions, :initialstate_distribution, :observation, :actionindex, :transition, :reward, :initialstate),Tuple{PyObject,PyObject,PyObject,Array{String,1},Array{String,1},Float64,Array{String,1},PyObject,PyObject,PyObject,PyObject,PyObject,String}}},POMDPPolicies.RandomPolicy{Random.MersenneTwister,QuickPOMDPs.QuickPOMDP{UUID("0fbc5ae6-f61e-43a8-ac7e-9abfa223a2ec"),String,String,String,NamedTuple{(:stateindex, :isterminal, :obsindex, :states, :observations, :discount, :actions, :initialstate_distribution, :observation, :actionindex, :transition, :reward, :initialstate),Tuple{PyObject,PyObject,PyObject,Array{String,1},Array{String,1},Float64,Array{String,1},PyObject,PyObject,PyObject,PyObject,PyObject,String}}},BeliefUpdaters.NothingUpdater},BeliefUpdaters.NothingUpdater,Random.MersenneTwister,Nothing,String}) at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyiterator.jl:150
[3] pyjlwrap_getiter(::Ptr{PyCall.PyObject_struct}) at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyiterator.jl:131
[4] macro expansion at /home/fansitca/.julia/packages/PyCall/ttONZ/src/exception.jl:81 [inlined]
[5] __pycall!(::PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyObject, ::Ptr{Nothing}) at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44
[6] _pycall!(::PyObject, ::PyObject, ::Tuple{Array{String,1}}, ::Int64, ::Ptr{Nothing}) at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:29
[7] #call#111 at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:11 [inlined]
[8] (::PyObject)(::Array{String,1}) at /home/fansitca/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:89
[9] top-level scope at none:0
[10] eval(::Module, ::Any) at ./boot.jl:319
[11] exec_options(::Base.JLOptions) at ./client.jl:243
[12] _start() at ./client.jl:425
=========================================
The code for reproducing that error is the following:
I am using Julia 1.0.5 (2019-09-09) and here is the list of installed packages:
Dict{String,Union{Nothing, VersionNumber}} with 18 entries:"BeliefUpdaters"=>v"0.1.2""POMDPModelTools"=>v"0.2.0""Distributions"=>v"0.21.8""QuickPOMDPs"=>v"0.2.0""BasicPOMCP"=>v"0.2.1""PyCall"=>v"1.91.2""QMDP"=>v"0.1.2""Compose"=>v"0.7.4""IJulia"=>v"1.20.2""Colors"=>v"0.9.6""POMDPSimulators"=>v"0.3.2""POMDPPolicies"=>v"0.2.1""SARSOP"=>v"0.4.0""StaticArrays"=>v"0.12.1""POMDPToolbox"=>v"0.3.0""POMDPGifs"=>v"0.1.0""POMDPs"=>v"0.8.1""Parameters"=>v"0.12.0"
The text was updated successfully, but these errors were encountered:
Hi @afansi , thanks for reporting this! I think it should be fairly straightforward to fix. I'm guessing the problem is that QuickPOMDPs is not recognizing that the PyObject is a function. I'll address it as soon as possible after the Thanksgiving holiday.
@afansi this has been fixed in the quick_pycall branch in #9 . see examples/issue_8.py for some changes that had to be made to the python code. Still deciding if I should merge it because it introduces a dependency on PyCall
Hello Guys,
I have been trying to use the QUICKPOMDPs interfaces with python. While I managed to use the DiscreteExplicitPOMDP interface, I am struggling in using the QuickPOMDP interface in python.
Indeed, here is the list of difficulties I am facing:
========================================
=============================================
here is my code:
==========================================
=========================================
The code for reproducing that error is the following:
Please note that the following code works properly when removing the "isterminal" parameter:
I am using Julia 1.0.5 (2019-09-09) and here is the list of installed packages:
The text was updated successfully, but these errors were encountered: