Greta 0.4.0 soft release

Hiya folks! {greta} 0.4.0 is nearly ready for release, and I am excited! This release features an overhauled installation helper, install_greta_deps().

We’d really appreciate it if people might be able to try it out - details here: https://greta-stats.org/articles/faq.html#how-do-i-install-greta-dependencies

We haven’t submitted this to CRAN yet - so you’ll need to install the development version, which you can do with:

options(
  repos = c(
    gretadev = 'https://greta-dev.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'
    )
  )

# Install greta
install.packages('greta')

There are also a heap of bug fixes and new features, detailed here: https://greta-stats.org/news/index.html.

We’re going to be doing more regular release cycles in the future, I’m excited for what is in the pipeline!

2 Likes

Dear Nick (if I am right),
it works rather well for me under Windows (and R 4.0.4). I just had to do an extra command suggested by R/greta about installing greta dependencies (Python et al) and to adjust the time allowed to do so (sorry, I did not note the exact command but it was straightforward based on the instructions).
Sincerely,
Frédéric

1 Like

Hi Frédéric!

OK great, I am so glad to hear it installed easily - we might look into increasing the time to a different default level such as 10 minutes instead of 5 to avoid those issues.

Thank you again for testing it out, really appreciate it!

Cheers,

Nick

Hey Nick, this looks to be a nice helper function. I gave it a shot using Docker and came up a bit short, but that may be something on my end (user error). install_greta_deps() didn’t error out, but it did just hang there with no apparent progress, even after setting the max timeout to 15 minutes. I did, however, get the reticulate instructions to work. The image works great, and could likely be built using a different baselayer in the rocker stack (e.g., rocker/geospatial:4.1.2). Here is what I’ve got:

FROM rocker/geospatial:4.1.2

# Download and install miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
ENV PATH=$PATH:/miniconda/condabin:/miniconda/bin

# Update R packages and install greta
RUN Rscript -e "update.packages(ask = FALSE)" && \
    R -e "devtools::install_github('greta-dev/greta')"

# Install greta dependencies
RUN R -e "reticulate::conda_create( \
            envname = 'greta-env', python_version = '3.7' \
            )" && \
    R -e "reticulate::conda_install( \
            envname = 'greta-env', \
            packages = c('numpy==1.16.4', 'tensorflow-probability==0.7.0', 'tensorflow==1.14.0') \
            )" && \
    R - e "greta::normal(0, 1)"

# Install packages required for greta’s plotting functionality
RUN R -e "install.packages(c('igraph', 'DiagrammeR'))"
1 Like

Dear all,
I actually met the same problems as lzachmann: what I reported previously was conditional on a previous greta installation. When I tried to install greta under Windows 10 on computers that did not have greta installed previously, I met the same problems as lzachmann: install_greta_deps() got stuck at the image stage. I worked it out by first using

then using the instructions above.
Sincerely,
Frédéric

1 Like

Hi folks,

Thanks so much for trying it out!

Sorry it didn’t quite work the way we had hoped, we are about to get a windows machine to start interactively testing Greta on, as there are a few issues we want to iron out.

I’m currently away from my laptop, but I’ll take a closer look at this issue soon, the timeout feature hasn’t been behaving as we would have liked.

Wow, thanks so much for making the docker image! I’m trying to collect a few greta docker images together, so I’ve linked your image there: https://github.com/greta-dev/greta/issues/408, these will eventually end up on the website / a greta dockerhub account

:metal: just lemme know if I can help build / test at all! Happy to help.

1 Like

OK great! Will let you know.

In the previous release of Greta, I had posted instructions on installing and configuring greta on a Windows 10 machine here greta on Windows 10

Since I’ve a preexisting Anaconda installment, I followed the steps I laid out at the above link and was able to install and configure correctly without using the new helper function. Another difference in my install is that (I noted in the link above) I install numpy=1.21.1 and not version 1.16.4

In the entire process, I get the following Warning:

tensorflow:From C:\ProgramData\ANACON~1\envs\gretf\lib\site-packages\tensorflow_probability\python\distributions\student_t.py:272: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where

Can any one help resolve this warning?

1 Like

Hi @sreedatta!

That’s great to hear that you were able to get greta working! Just to confirm, is that the current latest version of greta from GitHub, and not CRAN, installed using:

options(
  repos = c(
    gretadev = 'https://greta-dev.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'
    )
  )

# Install greta
install.packages('greta')

And

packageVersion("greta")

Returns 0.4.0 or higher?

Regarding your warning message:

tensorflow:From C:\ProgramData\ANACON~1\envs\gretf\lib\site-packages\tensorflow_probability\python\distributions\student_t.py:272: add_dispatch_support..wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where

This warning message is signifying a deprecation of existing functions used within greta and letting the user know that in TensorFlow >= 2.0.0 there will be a different interface. So it is safe to ignore this warning.

As for resolving it, I haven’t seen this error recently, but if you have some code (in the latest version of greta) that reliably shows this warning message I can take a look into a way to resolve it.

Let me know if you’ve got any questions or if I can help with anything!