Skip to content

Instantly share code, notes, and snippets.

```
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[13], line 8
6 print("works")
7 trainer.model.train(False)
----> 8 trainer.compute_loss(model, inputs, return_outputs=False, num_items_in_batch=416)
9 print("fails.")
12 orig_context_manager = trainer.compute_loss_context_manager
//g++ ../bullet3/examples/ThirdPartyLibs/glad/egl.c ../bullet3/examples/ThirdPartyLibs/glad/gl.c egl.cpp -std=c++11 -I ../bullet3/examples/ThirdPartyLibs/glad/ -lpthread -ldl
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <glad/egl.h>
#include <glad/gl.h>
import os
import glob
import multiprocessing
from collections import deque
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import pygame
from pdb import set_trace
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glad/glx.h>
#ifndef GLAD_IMPL_UTIL_C_
#define GLAD_IMPL_UTIL_C_
#if _MSC_VER >= 1400
#define GLAD_IMPL_UTIL_STRNCPY(dest, source, len) strncpy_s(dest, len, source, len-1);
//g++ egl_gl2.cpp ../../out2/src/egl.c ../../out2/src/gl.c -I ../../out2/include/ -l dl
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <glad/gl.h>
#include <glad/egl.h>
//g++ egl.cpp ../../out/src/egl_gl.c ../../out/src/gl.c -I ../../out/include/ -l dl
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <glad/gl.h>
#include <glad/egl.h>
class DataProvider(object):
def __init__(self,label_dict, top_blobs = None):
# for determinist evaluation
self.random_state = None
self.label_dict = label_dict
if top_blobs is None:
x = label_dict.values()[0]
if type(x) == int:
self.top_blobs = ["img", "label"]