# Using AbstractEnv from CommonRLInterface with POMDPs

**URL:** <https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730>\
**Category:** Machine Learning\
**Created:** [September 24, 2021, 10:10pm UTC](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730 "2021-09-24T22:10:34Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![zsunberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zsunberg/32/1883_2.png) [@zsunberg](https://discourse.julialang.org/u/zsunberg)\
**Post date:** [September 27, 2021, 9:13pm UTC](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730/21 "2021-09-27T21:13:45Z")

</div>

If we do report it to Julia, here is a MWE:

```julia
julia> struct X{T, A<:AbstractArray{T}}
           t::T
           a::A
       end
julia> Vector{X{Int, Vector{Float64}}}(undef, 2)
ERROR: TypeError: in X, in A, expected A<:(AbstractArray{T, N} where N), got Type{Vector{Float64}}
Stacktrace:
 [1] top-level scope
   @ REPL[15]:1

```

---

<div class="post-metadata">

**Author:** ![Tyler\_Ingebrand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tyler_ingebrand/32/21708_2.png) [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Post date:** [September 27, 2021, 9:29pm UTC](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730/22 "2021-09-27T21:29:52Z")

</div>

@zsunberg Your fix worked. Thank you!

I will figure out how to submit a ticket to Julia, thanks for the MWE!

For now, I am going to mark the comment about changing the return type to float32 as the fix since it can be done on the user’s side. That will help people in the short term resolve this. In the long term, your PR to DeepQLearning will prevent this from happening here, and hopefully Julia makes that error message more clear.

---

<div class="post-metadata">

**Author:** ![Tyler\_Ingebrand](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tyler_ingebrand/32/21708_2.png) [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Post date:** [September 27, 2021, 9:47pm UTC](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730/23 "2021-09-27T21:47:06Z")

</div>

Here is the issue for Julia: [https://github.com/JuliaLang/julia/issues/42401](https://github.com/JuliaLang/julia/issues/42401)  
Feel free to add anything I missed. They will probably value your input because you actually know what you are doing 😃  
Thanks again! You saved me so much time!

[Previous page](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730.md?page=1)
