Why does calling dyn.load in a for loop crash my R session? [closed] - r

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
R (3.3.2, Windows 7) crashes after about 1000 iterations of dyn.load() being used in a for loop. This does not happen in Ubuntu. This behaviour is observed for dll files created from Rcpp and TMB code, but I don't think it is related to either of these packages. The crash message is:
Problem Event Name: APPCRASH
Application Name: rsession.exe
Application Version: 1.0.136.0
Application Timestamp: 583f5668
Fault Module Name: testRcppRepeatDynLoad.dll
The following is a mimimal reproducible example on my computer:
First, create an Rcpp package called testRcppRepeatDynLoad (in Rstudio, create package in new directory, select 'create package with Rcpp'.). Building the package with CTRL-SHIFT-B creates a dll file in the src folder, which we will load using dyn.load.
This code crashes the R session after 1050 iterations:
while (i < 2000) {
i = i + 1
print(i)
dyn.load('src/testRcppRepeatDynLoad.dll')
dyn.unload('src/testRcppRepeatDynLoad.dll')
}
The same thing happens for a dll file created by TMB::compile.

Related

Im using kali linux . I added the tesseract library to maven and tried to read the matte from the image. and i got the following error : [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
sudo apt-get install tesseract-ocr; I ALSO TRIED USING !!!!!!!!
Error opening data file /kaliferganes/share/tesseract-ocr/4.00/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Exception in thread "main" net.sourceforge.tess4j.TesseractException: javax.imageio.IIOException: I/O error reading PNG header!

RuntimeError help stable diffusion webui [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 days ago.
Improve this question
Already up to date.
venv "D:\AI\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: ea9bd9fc7409109adcd61b897abc2c8881161256
Installing requirements for Web UI
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Loading weights [fe4efff1e1] from D:\AI\stable-diffusion-webui\models\Stable-diffusion\model.ckpt
Creating model from config: D:\AI\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(0):
Model loaded in 3.9s (load weights from disk: 1.0s, create model: 0.4s, apply weights to model: 0.5s, apply half(): 0.7s, move model to device: 0.5s, load textual inversion embeddings: 0.8s).
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Traceback (most recent call last):
File "D:\AI\stable-diffusion-webui\launch.py", line 361, in <module>
start()
File "D:\AI\stable-diffusion-webui\launch.py", line 356, in start
webui.webui()
File "D:\AI\stable-diffusion-webui\webui.py", line 232, in webui
app.add_middleware(GZipMiddleware, minimum_size=1000)
File "D:\AI\stable-diffusion-webui\venv\lib\site-packages\starlette\applications.py", line 135, in add_middleware
raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started
Press any key to continue . . .
I followed all the steps on github and I get this error https://github.com/AUTOMATIC1111/stable-diffusion-webui
Go into your SD folder right click open terminal and past this in then hit enter.
.\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1

What is the difference between "next": "12.2.5", and ^12.2.5 [duplicate]

This question already has answers here:
What's the difference between tilde(~) and caret(^) in package.json?
(19 answers)
Closed 6 months ago.
On my NextJS project, I got this error on Vercel:
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
I made my research and I got this solution:
Timer: You should install Next.js in your project via:
Why not? So, I did it on my project and this is the result changes:
"next": "12.2.5", -> "next": "^12.2.5",
My question: ¿What is the difference?
Thanks
Miguel
Your First Error shows that your lock file is created by using npm & you are installing now with yarn , so sometimes it causes issue. so it better to delete lock files while installing with other package managers like yarn.
seconde issues..
"12.2.5" - it must install exact version .
^12.2.5 - It will update you to all future minor/patch versions.
eg: ^12.2.5 will use releases from 12.2.5 to <13.0.0.
Refer.. What's the difference between tilde(~) and caret(^) in package.json?

Warning: unable to access index for repository https://www.stats.ox.ac.uk/pub/RWin/src/contrib: [duplicate]

This question already has answers here:
Problems with installation R packages
(3 answers)
Closed 5 years ago.
From today, every time I try to install a new package on R (3.4.1) with Rstudio 1.0.143 I receive this error message:
Warning: unable to access index for repository https://www.stats.ox.ac.uk/pub/RWin/src/contrib:
cannot open URL 'https://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'
I change the CRAN mirror in Global options>packages but it still shows this error. The packages have started downloading from a different server than stats.ox.ac.uk but there is huge delay while R tries to connect to stats.ox.ac.uk. Is this a global problem, or just happening to me? If global, is there a workaround to stop this serror message from showing?
Thanks.
Deep
(Dwaipayan Adhya)
I'm guessing this is a temporary issue (but an annoying one nonetheless and one that I dealt with this morning). That repository is most likely an additional one set alongside the "CRAN" repository as "CRANextra". The solution is to redefine the repos option to not include CRANextra. You can use the setRepositories() command and unselect "CRANextra". Alternatively you could just run the following code which will remove all repositories except the "CRAN" selection.
options(repos = getOption("repos")["CRAN"])

No package called rodbc [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am using R Studio where I have installed RODBC successfully as it works fine when I run a .r script. However, when I use the very same code in an .Rmd file I get an error saying
Error in library("rodbc") : there is no package called 'rodbc'
Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> library"
Please note that R is case sensitive. You have written in lowercase thats the reason you are getting error.
You can write like:
library("RODBC")
or
library(RODBC)

Resources