Code Monkey home page Code Monkey logo

Comments (11)

iWooda avatar iWooda commented on May 18, 2024 5

MacOS
M1

scripts/gui.sh: line 1: python: command not found
Line 1 😭 ,How to resolve it?Help me pls

from draggan.

Pawandeep-prog avatar Pawandeep-prog commented on May 18, 2024 3

Getting this error

Traceback (most recent call last):
  File "/Users/pawandeepsingh/Documents/Development/official_draggan/DragGAN/visualizer_drag.py", line 404, in <module>
    main()
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/pawandeepsingh/Documents/Development/official_draggan/DragGAN/visualizer_drag.py", line 363, in main
    viz = Visualizer(capture_dir=capture_dir)
  File "/Users/pawandeepsingh/Documents/Development/official_draggan/DragGAN/visualizer_drag.py", line 31, in __init__
    super().__init__(title='DragGAN', window_width=3840, window_height=2160)
  File "/Users/pawandeepsingh/Documents/Development/official_draggan/DragGAN/gui_utils/imgui_window.py", line 43, in __init__
    self._imgui_renderer = _GlfwRenderer(self._glfw_window)
  File "/Users/pawandeepsingh/Documents/Development/official_draggan/DragGAN/gui_utils/imgui_window.py", line 102, in __init__
    super().__init__(*args, **kwargs)
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/imgui/integrations/glfw.py", line 12, in __init__
    super(GlfwRenderer, self).__init__()
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/imgui/integrations/opengl.py", line 60, in __init__
    super(ProgrammablePipelineRenderer, self).__init__()
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/imgui/integrations/base.py", line 17, in __init__
    self._create_device_objects()
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/imgui/integrations/opengl.py", line 108, in _create_device_objects
    self._attrib_location_tex = gl.glGetUniformLocation(self._shader_handle, "Texture")
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/OpenGL/latebind.py", line 63, in __call__
    return self.wrapperFunction( self.baseFunction, *args, **named )
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 430, in glGetUniformLocation
    return baseOperation( program, name )
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 415, in __call__
    return self( *args, **named )
  File "/Users/pawandeepsingh/miniforge3/lib/python3.9/site-packages/OpenGL/error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
	err = 1282,
	description = b'invalid operation',
	baseOperation = glGetUniformLocation,
	cArguments = (1, b'Texture\x00'),
	result = -1
)

any help would be appreciated :)

from draggan.

Pawandeep-prog avatar Pawandeep-prog commented on May 18, 2024 2

after further tracking the code,

found that the fault is due to this line

self.set_window_size(window_width, window_height)

from gui_utils/glfw_window.py in the init() function.

from draggan.

aBner6667 avatar aBner6667 commented on May 18, 2024 2

I can open the generated web address, and the interactive content is displayed correctly. However, once I click to manipulate the image, it shows an error: ”Expecting value: line 1 column 1 (char 0)“,
I am a computer newbie, please help me.

MacOS M1

from draggan.

alex-calderwood avatar alex-calderwood commented on May 18, 2024 1

@albusdemens when you say fixed, do you mean the project was running?

from draggan.

Pawandeep-prog avatar Pawandeep-prog commented on May 18, 2024

okay resolved segmentation fault

it was due to
self.monitor_height and self.monitor_width variables
in the same file def set_window_size(self, width, height): this function

I removed them and hard coded 1920 and 1080 instead.

from draggan.

albusdemens avatar albusdemens commented on May 18, 2024

@Pawandeep-prog I fixed the issue by following this suggestion.

from draggan.

Pawandeep-prog avatar Pawandeep-prog commented on May 18, 2024

I think it require cuda to run as I see in stylegan3 repo, and I am running Mac m1 maybe that is the issue. :(

from draggan.

oscarmore2 avatar oscarmore2 commented on May 18, 2024

I track my issue, I found the problem is caused by : _, _, _width, height = glfw.get_monitor_workarea(glfw.get_primary_monitor()), in glfw_window.py, line 82.
My macbook pro is MacOS Monterey 2021, M1 pro chip.
It return a null pointer while it tried to query the monitor size, but fail
It seems like the glfw library didn't have good support in arm chip. Maybe using Metal could resolve it?

from draggan.

Pawandeep-prog avatar Pawandeep-prog commented on May 18, 2024

I also had problem over there, didn't found any solution so I hard coded these values. :(

from draggan.

siyun-liang avatar siyun-liang commented on May 18, 2024

I try:

        glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
        glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 3)
        glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, glfw.TRUE)
        glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)

I want to set the openGL context to 3.3, while:
version = gl.glGetString(gl.GL_VERSION)
print("OpenGL Version:", version)
prints OpenGL Version: b'4.1 Metal - 83.1'. (without the change it prints 2.1 Metal)

With this change:
self._imgui_renderer = _GlfwRenderer(self._glfw_window)
in line 40, imgui_window.py throws no exception.

But further exception was thrown: gui_utils/glfw_window.py", line 193, in begin_frame

OpenGL.error.GLError: GLError(
	err = 1282,
	description = b'invalid operation',
	baseOperation = glMatrixMode,
	cArguments = (GL_PROJECTION,)
)

from draggan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.