How to fix Foundry Nuke Runtime Error: Read1? - python

After rendering nuke video in python I caught
Traceback (most recent call last):
document_celery_worker_1 | File "/usr/src/morda/vc/nuke/motions/scale_in_scale_out.py", line 79, in apply
document_celery_worker_1 | nuke.render(output)
document_celery_worker_1 | RuntimeError: Read1: /tmp/tmpq6ri2xk9.mov:
this traceback. Interesting that output looks correct anyway. But I want to get rid of this exception. Unfortunately there is no detail explanation of this. Any ideas what's the problem?
This is how I read file:
content = nuke.createNode("Read")
content["file"].fromUserText(content_file_path)

my guess would be something along the lines of "write1 cannot be executed over multiple frames", but without seeing the code & script there's no way to be sure. If you save the script created from code as a .nk, open it and try rendering in the app, does it give you more relevant info?

Related

why is the error thinking Its not string?

path of file is:
"C:\Users\deana\OneDrive\Marlon's files\Programming\Python\PITT\PITT_LIbrary\Lists\test.txt"
lines of code are:
import os
os.chdir("C:/Users/deana/OneDrive/Marlon's files/Programming/Python/PITT/PITT_LIbrary/Lists")
exec(open('test.txt'))
the error is this:
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
exec(open('test.txt'))
TypeError: exec() arg 1 must be a string, bytes or code object
also if I try on one line as such:
exec(open(r"C:/Users/deana/OneDrive/Marlon's files/Programming/Python/PITT/PITT_LIbrary/Lists/test.txt"))
i'ts the same error. (with and without r)
super frustrationg as it reads like i'm not inputting string... but it is string!?!
also I've done this litteraly the same way before, restarted IDLE shell, no difference.
ugh! I always get stupid errors with file paths.
I should have been using os.startfile() to open this.
It was confusing by using .open(). as I was attempting to open in default app.
before, i've used exec.open() to open .py files and guess I got them confused.
exec is just used to open other scripts... need stronger coffee next time.
Try this:
import os
os.chdir("C:/Users/deana/OneDrive/Marlon's files/Programming/Python/PITT/PITT_LIbrary/Lists")
exec(open('test.txt', 'rb'))
You can convert the txt file to bytes by opening it with rb (read bytes).

What's causing this np.array data type error, and what's the fix?

I'm working on an image output project-- I can't figure out what the problem specific to this line is: Traceback (most recent call last):
input_array[i].append(np.array(Image.fromarray(img_input).resize(float(g_scale), resample=Image.BICUBIC)))
TypeError: Cannot handle this data type
The "cannot handle this data type" was manually written in case an error like this happened. I searched up multiple possibilities as to the problem with the Image.fromarray line and couldn't narrow it down to this specific line's needs. Could appreciate any help!
Here's a more full view of the for loop being used, it's essentially testing the network:
for i, gscale in enumerate(gscales):
if float(g_scale) == 1:
input_array[i].append(img_input)
else:
input_array[i].append(np.array(Image.fromarray(img_input).resize(float(g_scale), resample=Image.BICUBIC)))
output_array[i].append(eval_model.predict_on_batch(input_array[i][-1]))
Depending on your editor, it might be because you used g_scale rather than gscale inside the for loop. It could have skipped the variable name error and instead pick up on the error from the line after else.

How to fix syntax error at semicolon before equal

I am running a code taken from the website
http://foreverlearning.altervista.org/genetic-programming-symbolic-regression-pt-2/
at the bottom of the page. This is a part when testing treeOperations.py.
To test this code, I run the mainprova.py code that is provided at the bottom of the page after treeOperations.py listing. I am getting the following syntax error:
python mainprova3.py
Traceback (most recent call last):
File "mainprova3.py", line 2, in <module>
import treeOperations as trop
File "/home/adam/DocumentsNew2/MathCode/SymbolicRegression/WebpageCode /treeOperations.py", line 23
if choice <= leftNodes:
^
SyntaxError: invalid syntax
I am new to python. I do not understand the semicolon before equal sign. What it means? How do I fix it?
< is the HTML entity for <. There is apparently some sort of bug in the linked site that is causing things to be HTML-escaped that shouldn't be. Replace <= with <=.
You apparently copied the code from the GitHub page while looking at the html. Try just cloning the project:
git clone https://github.com/fabiochiusano/SymbolicRegressionPy.git
Or, if you don't have git, look at the file in 'raw' and then save it, instead of copying it off the nicer-looking page. For example, like this: https://raw.githubusercontent.com/fabiochiusano/SymbolicRegressionPy/master/symreg/treeOperations.py
You can go here: https://github.com/fabiochiusano/SymbolicRegressionPy
and click on clone or download > Download zip to download all the correct code files at once.

How to fix this error while executing a program

C:\Users\skandregula\AppData\Local\Programs\Python\Python37\python.exe
C:/Users/skandregula/Desktop/TestFiles2/testing.py
Traceback (most recent call last):
File "C:/Users/skandregula/Desktop/TestFiles2/testing.py", line 30, in <module>
with open(in_dir + f, 'r') as tmp_file:
FileNotFoundError: [Errno 2] No such file or directory:
'C:/Users/skandregula/Desktop/TestFiles2/history.log.3.3C'
Process finished with exit code 1
that is the error i am running right now...How to fix this?
Without seeing what your code looks like, I'm assuming somewhere in your code you're referencing a file or folder named 'history.log.3.3C' as the error suggests, and that it cannot find it in your directory given. My best advice is make sure the directory is correct?
Hard to tell without seeing what you're trying to do. Maybe posting a snippet of your code would help.

WindowsError: priveledged instruction when saving a FreeImagePy Image in script, works in IDLE

I'm working on a program to do some image wrangling in Python for work. I'm using FreeImagePy because PIL doesn't support multi-page TIFFs. Whenever I try to save a file with it from my program I get this error message (or something similar depending on which way I try to save):
Error returned. TIFF FreeImage_Save: failed to open file C:/OCRtmp/ocr page0
Traceback (most recent call last):
File "C:\Python25\Projects\OCRPageUnzipper\PageUnzipper.py", line 102, in <mod
ule> OCRBox.convertToPages("C:/OCRtmp/ocr page",FIPY.FIF_TIFF)
File "C:\Python25\lib\site-packages\FreeImagePy\FreeImagePy\FreeImagePy.py", l
ine 2080, in convertToPages self.Save(FIF, dib, fileNameOut, flags)
File "C:\Python25\lib\site-packages\FreeImagePy\FreeImagePy\FreeImagePy.py", l
ine 187, in Save return self.__lib.Save(typ, bitmap, fileName, flags)
WindowsError: exception: priviledged instruction
When I try and do the same things from IDLE, it works fine.
Looks like a permission issues, make sure you don't have the file open in another application, and that you have write permissions to the file location your trying to write to.
That's what I thought too, but I figured it out a couple hours ago. Apparently if the directory/file I'm trying to write to doesn't exist, FreeImagePy isn't smart enough to create it (most of the time. Creating a new multipage image seems to work fine) but i guess running it within IDLE, IDLE figures it out and takes care of it or something. I managed to work around it by using os.mkdir to explicitly make sure things that I need exist.

Categories